tags:

views:

60

answers:

1

I have created a php webpage. I now want to create a launcher application in android phone, it simply opens the browser with the url "http://<mywebsite>/m".

I use uri intent to launch the browser in onCreate function.

public void onCreate(...)
{
    ....
    startActivity(new Intent(Intent.ACTION_VIEW, new Uri(http://<mywebsite>/m)));
    ...
}

I execute this program in my G1 phone (Cyan Mod 5). However, when I click the "Home" key, and then re-enter my application through Task list, I lose focus for my last started browser, and the screen blank

Any suggestion?! Should I need any code in onResume function to re-focus my web!?

A: 

If you call finish() after startActivity, your 'redirect' activity will be closed and removed from the task's activity stack, leaving just the browser activity. For more on the basics, read the developer guide section on activities and tasks.

Roman Nurik