Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch event of coming back to an activity after hitting back

I have a main screen for my application which then leads to different screens, from each of those hitting back takes you back to the main screen. I want to do some stuff every time a user is "coming back" to the main screen, How do I catch this kind of event???

like image 801
Yuval Avatar asked Jul 09 '11 16:07

Yuval


1 Answers

Use onResume() method in your main activity or Use startActivityForResult method in your activity by overriding the keyDown method in sub activities,it may help you

like image 52
sunriser Avatar answered Oct 06 '22 00:10

sunriser