Re: [android-developers] Re: How to solve the problem of launch the apps twice or more?

2010-04-21 Thread Mark Murphy
Kenneth WON wrote: The purpose of this app is to run the service forever until shutdown the phone, and after the user leaves the app and return later, the service will not launch again, means only have one of this service running. Please don't do that. First, it's not possible:

Re: [android-developers] Re: How to solve the problem of launch the apps twice or more?

2010-04-20 Thread Dianne Hackborn
Make sure you aren't calling startActivity() anywhere, such as in onCreate(). Look at the log (adb logcat) and event log (adb logcat -b events) to see what the system is saying about launching and handling activities. Please don't use singleTask or singleInstance to fix such problems, they are

Re: [android-developers] Re: How to solve the problem of launch the apps twice or more?

2010-04-20 Thread Dianne Hackborn
Starting a service doesn't have anything to do with the activity stack. It is only needed if you actually must have a service running even after the user leaves your app. (And of course you must have a good plan for how you will stop the service, so it doesn't get left running forever.) On Tue,