diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2019-04-25 09:18:31 +0530 |
---|---|---|
committer | Harsh Shandilya <msfjarvis@gmail.com> | 2019-04-25 09:18:31 +0530 |
commit | 00e2cf352fe08252853c4d271711d96b9456ef26 (patch) | |
tree | 32f816c1c7dad64f69119aea2e38cef177b409bf /app/src/main/java/com/zeapo | |
parent | 655b3a11f4eb448bf68a49d1f8051e0c0d100ef4 (diff) |
PasswordStore: Resolve some IDE warnings
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 8a5acec8..f20c3f2e 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -160,24 +160,17 @@ public class PasswordStore extends AppCompatActivity { } @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) { - switch (requestCode) { - case REQUEST_EXTERNAL_STORAGE: { - // If request is cancelled, the result arrays are empty. - if (grantResults.length > 0 - && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - checkLocalRepository(); - } + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + // If request is cancelled, the result arrays are empty. + if (requestCode == REQUEST_EXTERNAL_STORAGE) { + if (grantResults.length > 0 + && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + checkLocalRepository(); } } } @Override - public void onPause() { - super.onPause(); - } - - @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main_menu, menu); @@ -199,7 +192,7 @@ public class PasswordStore extends AppCompatActivity { // When using the support library, the setOnActionExpandListener() method is // static and accepts the MenuItem object as an argument - MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() { + searchItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { @Override public boolean onMenuItemActionCollapse(MenuItem item) { refreshListAdapter(); @@ -341,7 +334,7 @@ public class PasswordStore extends AppCompatActivity { } } - final Set<String> keyIds = settings.getStringSet("openpgp_key_ids_set", new HashSet<String>()); + final Set<String> keyIds = settings.getStringSet("openpgp_key_ids_set", new HashSet<>()); if (keyIds.isEmpty()) new AlertDialog.Builder(this) @@ -602,7 +595,7 @@ public class PasswordStore extends AppCompatActivity { @Override public void execute() { Log.d(TAG, "Committing with message " + message); - Git git = new Git(this.repository); + Git git = new Git(repository); GitAsyncTask tasks = new GitAsyncTask(activity, false, true, this); tasks.execute( git.add().addFilepattern("."), |