mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Remove unnecessary var re-assignment
This commit is contained in:
parent
70c439417f
commit
8c6046feda
1 changed files with 3 additions and 6 deletions
|
|
@ -584,7 +584,7 @@ public class CategorizationFragment extends Fragment {
|
|||
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
||||
switch(menuItem.getItemId()) {
|
||||
case R.id.menu_save_categories:
|
||||
ArrayList<String> selectedCategories = new ArrayList<String>();
|
||||
final ArrayList<String> selectedCategories = new ArrayList<String>();
|
||||
int numberSelected = 0;
|
||||
|
||||
for(CategoryItem item: categoriesAdapter.getItems()) {
|
||||
|
|
@ -594,9 +594,6 @@ public class CategorizationFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
//Need to reassign to a final variable to use in inner class
|
||||
final ArrayList<String> finalCategories = selectedCategories;
|
||||
|
||||
//If no categories selected, display warning to user
|
||||
if (numberSelected == 0) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
|
|
@ -612,7 +609,7 @@ public class CategorizationFragment extends Fragment {
|
|||
builder.setNegativeButton("Yes, submit", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
//Proceed to submission
|
||||
onCategoriesSaveHandler.onCategoriesSave(finalCategories);
|
||||
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
|
@ -621,7 +618,7 @@ public class CategorizationFragment extends Fragment {
|
|||
dialog.show();
|
||||
} else {
|
||||
//Proceed to submission
|
||||
onCategoriesSaveHandler.onCategoriesSave(finalCategories);
|
||||
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue