How can I find out the stack? Is it dumped somewhere in the file system?

One thing I have been suspecting is that the mContext of PhoneWindowManager may not be a normal app content to launch an activity, but I am sure someone else should know better ... :)

Cheers.

jun

Dianne Hackborn wrote:
Well what is the stack crawl when it crashes?

On Fri, Jan 22, 2010 at 3:27 PM, Jun Sun <monkey.j...@gmail.com <mailto:monkey.j...@gmail.com>> wrote:

    My goal is to launch web browser when I press the HOME key *when*
    phone is already at home page.

    Since this is hard (for me anyway), my first shot is to modify the
    HOME key long-press behavior so that it will launch the web browser.

    Thanks to Fei Zhang, who has correctly pointed me to the
    PhoneWindowManager.java file, I am able to locate the right place
    and inject the code to launch browser. See the code snippet below.

    Unfortunately, it does not work. If I do long-press twice, the whole
    UI interface resets (re-starting from flickering "ANDROID" logo).
    Does anybody have any ideas? I'd really appreciate.

    My device is ADP1. My tree is donut branch. My build host is FC11.

    Cheers.

    Jun

    --------------------
    PhoneWindowManager.java:

    ...

       Runnable mHomeLongPress = new Runnable() {
           public void run() {
               /*
                * Eat the longpress so it won't dismiss the recent apps
    dialog when
                * the user lets go of the home key
                */
               mHomePressed = false;
               performHapticFeedbackLw(null,
    HapticFeedbackConstants.LONG_PRESS, false);
               sendCloseSystemWindows(SYSTEM_DIALOG_REASON_RECENT_APPS);
               showRecentAppsDialog();
           }
       };

       void showRecentAppsDialog() {
           /* [jsun] */
           mContext.startActivity(new Intent(Intent.ACTION_VIEW,
    Uri.parse("http://m.google.com/";)));
           /*
           if (mRecentAppsDialog == null) {
               mRecentAppsDialog = new RecentApplicationsDialog(mContext);
           }
           mRecentAppsDialog.show();
           */
       }

-- unsubscribe: android-porting+unsubscr...@googlegroups.com
    <mailto:android-porting%2bunsubscr...@googlegroups.com>
    website: http://groups.google.com/group/android-porting




--
Dianne Hackborn
Android framework engineer
hack...@android.com <mailto:hack...@android.com>

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.

--
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to