I have an Activity_A where there is a ListView whose data depends on a value say dependency
From this Activity_B user goes to Activity_B where he can change the value of dependency
since this dependency must change the data in the ListView i need to reload the ListView, hence i did this:
if(//dependency is changed){
Intent intent = new Intent(Activity_B.this,Activity_A.class);
startActivity(intent);
}
the ListView is populated with new data.
Problem:
when i press device back button from this newly loaded Activity_A twice, I end up in Activit_A with previous ListView data. So, if i try to click any item i get this Exception
The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread
How to avoid this??
Thank You
You can store
dependencyvalue inSharedPreferencesand populate your list based on thedependencyvalue in theActivity_AonResume()