Android newbie problem: restarting an application
I have an Android app that works fine the first time you run it. However, when you press HOME (so it pauses), and restart it from the home screen all I get is the music restarted.
I've not yet got to the stage of saving/restoring states yet (will do soon!). It seems that the main update thread is not resuming.
It calls onRestart()
fine...
I'm new to Java/Android so I apologize if this is a basic schoolboy error!
TIA for 开发者_如何学Cany advice
John
Programming applications for Android is a bit different then programming for conventional operating systems. Android stops your application when it looses focus. You'll have to read about activity lifecycle. If you're creating some kind of music player you should consider using a background service with a worker thread.
精彩评论