I have two Fragment classes and a dragEventListner class in an activity. Each fragment class has a imageScroller which is controlled by their own imageAdapter and listArray. Fragment1 class has a set of images which is dragged and dropped into Fragment2. Images are read from the sd-card. When an image is dropped, I update the listArray of Fragment2 and call <adapter>.notifyDataSetChanged(). Image gets added to the list (as I see in file explorer) but the changes don’t show up in the activity (i.e. I can’t see the dropped image) until I restart the app. However, I tried restarting the app by finish() and then calling an already saved intent. The code below:
Intent intent = getIntent();
finish();
startActivity(intent);
This doesn’t work best due to popup crash message Unfortunately, app has stopped working and then resuming. Is restarting the app only solution to this or I still have other options?
Are you using notifyDataSetChanged() on the adapter of the imagescroller? i have something similar in my project:
where mPAger is a view pager, i just add an item to the list and call notify() in your case mPager would be your imageScroller