Starting activity from service/receiver ?Bugged in 1.6 ?

Put your problem here if it does not fit any of the other categories.

Starting activity from service/receiver ?Bugged in 1.6 ?

Postby powerdeng » Thu Nov 05, 2009 4:54 am


I have a service that sometimes starts applications.
The problem is: if the *previous app* (any app) was recently
exited via the home key, then the following message
appears in the log:
ActivityManager: Activity start request from 10024 stopped
And there's then around a 5 second delay before the target
app (any) is launched.
If the previous app was exited with the back key, there's
no problem.
If the previous app exited more than a few second ago,
no problem.
The same also occurs with a broadcast receiver (which
also requires the NEW_TASK intent flag to launch an activity).
I don't know if the delay was there in 1.5, but I'm
assuming not since I can't find the error message in
the 1.5 source code.
Launch code is below.
A 5 second delay is really ruinous for my application,
a hint, solution or workaround would be great if anyone has
Intent intent = new Intent( Intent.ACTION_MAIN );
intent.addCategory( Intent.CATEGORY_LAUNCHER );
new ComponentName(
pkg, cls
intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
intent.addFlags( Intent.FLAG_FROM_BACKGROUND);
//I've tried every conceivable combination of other
// Intent flags here
startActivity( intent );
Posts: 9
Joined: Mon Feb 16, 2009 10:20 am
Location: Chengdu,China


Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 2 guests