0

I need to update adapter after some activity has finished. Any idea how to do it?

--EDIT --

I have an activity where I have to update data set after some other activity finishes which first one starts. Do I have to pass itself to the started activity?

oneat
  • 10,778
  • 16
  • 52
  • 70
  • Why would you want to update the adapter in an activity that is finishing? You need to provide more context and code usually doesn't hurt. But your activity will call `onFinish()` when it is...finishing. So you could override that and do what you are trying there. Assuming you call `finish()` – codeMagic Jun 19 '15 at 19:51
  • Is is to update the previous one when the user closes the current activity ? If yes, use OnResume. – Stephane Mathis Jun 19 '15 at 19:53
  • See the target link. You can update it in `onActivityResult()` in the first one – codeMagic Jun 19 '15 at 19:55

1 Answers1

0

Try overriding either the onStop() or the onPause() method and add code to do your work. Use onPause() if you want to update the adapter when the user minimizes the app. Use onStop() if you want to update the adapter when the user exits the activity and it is about to be destroyed.

Pratyush Yadav
  • 271
  • 1
  • 13