mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
fix memory leaks (they happened due to hiding keyboard) and lint null pointer warnings in the same code (#1471)
This commit is contained in:
parent
6d2c41b91e
commit
35f05be8df
5 changed files with 39 additions and 32 deletions
|
|
@ -128,7 +128,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
|||
|
||||
forgotPasswordText.setOnClickListener(view -> forgotPassword());
|
||||
|
||||
if(BuildConfig.FLAVOR == "beta"){
|
||||
if(BuildConfig.FLAVOR.equals("beta")){
|
||||
loginCredentials.setText(getString(R.string.login_credential));
|
||||
} else {
|
||||
loginCredentials.setVisibility(View.GONE);
|
||||
|
|
@ -145,8 +145,12 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
|||
}
|
||||
|
||||
public void hideKeyboard(View view) {
|
||||
InputMethodManager inputMethodManager =(InputMethodManager)this.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
if (view != null) {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager) this.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
if (inputMethodManager != null) {
|
||||
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue