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:
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
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,
3 matches
Mail list logo