1

I'm currently developing an android app with eclipse. Basicaly when the home button is pressed, the app automaticaly call the onPause() method. In onPause() I put method to pause the background music. When the app is opened again, I'm want to put method to play the music but I don't know where to put it. Anyone know where to put method that we want to call 1st when the app is re-opened?

Bobby Chandra
  • 89
  • 2
  • 10
  • http://stackoverflow.com/questions/10349685/not-able-disable-home-button-on-specific-android-devices. you cannot override the default behaviour of home button (as of android 4.0 i guess). This is for security reasons. Home button is one sure short way to navigate to home screen. – Raghunandan May 25 '13 at 18:32

1 Answers1

0

Anyone know where to put method that we want to call 1st when the app is re-opened

You have to put it in the onResume() method.

Take a look at the Activity lifecycle:

enter image description here

Ahmad
  • 69,608
  • 17
  • 111
  • 137