I have an activity that loads and displays data fetched from a web service.
While the activity is fetching data, it will show a progress dialog.
Now, on this activity, there is a button that will open a new activity, to edit the data. What I want is, after I edit the data, the EditActivity finish(), and the screen will display an updated data (after fetching the data again).
So, I put the fetchData() method in onPostResume() of the first activity. The problem is, everytime the progress dialog is dismissed, it triggers onPostResume() as well. So, I am stuck in a loop.
Any suggestions?
EDIT: Okay, so using onActivityResult() fixes that!
New problem though, what if the views that I want to update is in a fragment? I tried using onActivityResult, but it does nothing!