pressing home button to launch the web browser

by Dianne Hackborn » Sat, 23 Jan 2010 10:16:40 GMT


Sponsored Links
 Well what is the stack crawl when it crashes?




> website: 



pressing home button to launch the web browser

by Jun Sun » Mon, 25 Jan 2010 12:40:27 GMT


 ig thanks for pointing to this useful debugging feature ("adb
logcat"). I have fixed the problem.

As I suspected, the context is a system service, which is not suitable
to start an intent activity. And the error message actually gives a
clue on the fix, which is to add FLAG_ACTIVITY_NEW_TASK flag.

Below is the new snippet that works to make the record complete. I
also attached the related log output.

Cheers.

Jun

-------------------

void showRecentAppsDialog() {
// [jsun]

Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://192.168.0.1/"));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(i);
/*
if (mRecentAppsDialog == null) {
mRecentAppsDialog = new RecentApplicationsDialog(mContext);
}
mRecentAppsDialog.show();
*/
}


-------------------

W/dalvikvm( 76): threadid=39: thread exiting with uncaught exception
(group=0x4001da28)^M
E/AndroidRuntime( 76): Uncaught handler: thread WindowManagerPolicy
exiting due to uncaught exception^M
E/AndroidRuntime( 76): *** EXCEPTION IN SYSTEM PROCESS. System will crash.^M
I/ActivityManager( 76): Start proc com.android.settings for
broadcast com.android.settings/.widget.SettingsAppWidgetProvider:
pid=253 uid=1000 gids={3002, 3001, 3003}^M
E/AndroidRuntime( 76): android.util.AndroidRuntimeException: Calling
startActivity() from outside of an Activity context requires the
FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?^M
E/AndroidRuntime( 76): at
android.app.ApplicationContext.startActivity(ApplicationContext.java:649)^M
E/AndroidRuntime( 76): at
com.android.internal.policy.impl.PhoneWindowManager.showRecentAppsDialog(PhoneWindowManager.java:425)^M
E/AndroidRuntime( 76): at
com.android.internal.policy.impl.PhoneWindowManager$2.run(PhoneWindowManager.java:416)^M
E/AndroidRuntime( 76): at
android.os.Handler.handleCallback(Handler.java:587)^M
E/AndroidRuntime( 76): at
android.os.Handler.dispatchMessage(Handler.java:92)^M
E/AndroidRuntime( 76): at android.os.Looper.loop(Looper.java:123)^M
E/AndroidRuntime( 76): at
com.android.server.WindowManagerService$PolicyThread.run(WindowManagerService.java:509)^M
I/Process ( 76): Sending signal. PID: 76 SIG: 9^M
...

On Sat, Jan 23, 2010 at 2:52 PM, Dianne Hackborn <hack...@android.com> wrote:

--


Sponsored Links


Other Threads

1. got a couple of android G1 Google phone questions for you all...





Hi Kipling Inscore,
        You said that the poor battery life time  is due to the frequently
usage of GPS or WiFi. But I'm wondering if the Arm11 CPU, running at
528MHZ  is not a cause for this poor battery life time???

--~--~---------~--~----~------------~-------~--~----~

2. Running an app when Android boots

Hey,

Is there a way I can start an app as soon as android boots? I've been
reading the documentation but couldn't find anything about that.

Thanks,
Moazzam

--~--~---------~--~----~------------~-------~--~----~

3. how can I make a sequence of animation?

4. Starting specific SystemSettings-Subcategories does not work.

5. Application install unsuccessful after signing

6. com.android.email - Should I stay or should I fork now?

7. Runtime exception with JSONObject.put() ???