views:

32

answers:

1

I have added a menu to ListView Activity and wanted to allow the user to select the information that would be displayed in the ListView. So for example:

  • The ListView is populated in the onCreate method.
  • The user selects an option in the menu.
  • Upon the user making this selection the ListView would be populated with a different array.

Is onResume() executed after the menu is closed? I would test this but I am not currently home. What is the best way to do this?

Thanks, Rob

+1  A: 

No, OnResume is not called when the menu is closed. What you want to do is put the code that swaps out the information in the adapter in the OnMenuItemSelected method.

CaseyB
Alright so if I grab my ListView and set a new ArrayAdapter using listView.setAdapter(); will it automatically "repopulate" the list?
Tarmon
Or do I want just call setListAdapter like I do in my onCreate() method?
Tarmon
These two are equivalent. You can do it either way.
CaseyB