@@ -584,7 +584,7 @@ public void onSaveInstanceState(Bundle outState) {
584
584
public boolean onOptionsItemSelected (MenuItem menuItem ) {
585
585
switch (menuItem .getItemId ()) {
586
586
case R .id .menu_save_categories :
587
- ArrayList <String > selectedCategories = new ArrayList <String >();
587
+ final ArrayList <String > selectedCategories = new ArrayList <String >();
588
588
int numberSelected = 0 ;
589
589
590
590
for (CategoryItem item : categoriesAdapter .getItems ()) {
@@ -594,9 +594,6 @@ public boolean onOptionsItemSelected(MenuItem menuItem) {
594
594
}
595
595
}
596
596
597
- //Need to reassign to a final variable to use in inner class
598
- final ArrayList <String > finalCategories = selectedCategories ;
599
-
600
597
//If no categories selected, display warning to user
601
598
if (numberSelected == 0 ) {
602
599
AlertDialog .Builder builder = new AlertDialog .Builder (getActivity ());
@@ -612,7 +609,7 @@ public void onClick(DialogInterface dialog, int id) {
612
609
builder .setNegativeButton ("Yes, submit" , new DialogInterface .OnClickListener () {
613
610
public void onClick (DialogInterface dialog , int id ) {
614
611
//Proceed to submission
615
- onCategoriesSaveHandler .onCategoriesSave (finalCategories );
612
+ onCategoriesSaveHandler .onCategoriesSave (selectedCategories );
616
613
return ;
617
614
}
618
615
});
@@ -621,7 +618,7 @@ public void onClick(DialogInterface dialog, int id) {
621
618
dialog .show ();
622
619
} else {
623
620
//Proceed to submission
624
- onCategoriesSaveHandler .onCategoriesSave (finalCategories );
621
+ onCategoriesSaveHandler .onCategoriesSave (selectedCategories );
625
622
return true ;
626
623
}
627
624
}
0 commit comments