how to programatically pause an application?

by guich » Tue, 15 Jun 2010 22:03:47 GMT


Sponsored Links
 Hi,

How can i simulate pressing the HOME key to put my application in
pause mode? Currently i call finish() but it destroys the application.

thanks

    guich

--



how to programatically pause an application?

by Mark Murphy » Tue, 15 Jun 2010 22:06:55 GMT


 


Call startActivity() on an Intent with ACTION_MAIN with category
CATEGORY_HOME -- that will launch the home screen.

-- 
Mark Murphy
CommonsWare
mmur...@commonsware.com
 http://commonsware.com 

--


Sponsored Links


how to programatically pause an application?

by guich » Tue, 15 Jun 2010 22:42:56 GMT


 Thanks, but something went wrong.
I can see the onPause and onResume being called for my app, but the
screen is blank after the resume. This does not happen when i press
the home key.

Maybe there's a way to simulate the home key?

thx

  guich

--



how to programatically pause an application?

by Joe Onorato » Wed, 16 Jun 2010 05:50:30 GMT


 This is the intent that's launched when you press the home key:

        mHomeIntent =  new Intent(Intent.ACTION_MAIN, null);
        mHomeIntent.addCategory(Intent.CATEGORY_HOME);
        mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);

-joe









--



Other Threads

1. AdMob for Android

If anyone is interesting in putting some ads in their apps, AdMob
released an SDK today. Seems to work ok and I put a quick start guide
together on http://jtribe.blogspot.com/2009/01/admob-for-android.html

Hope it helps ...

Daniel

--
iPhone, Android and Geolocation ramblings - http://jtribe.blogspot.com/
Android Market Stats - http://androidstats.com


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

2. Not able to build Browser Source Code on android-sdk-windows-1.0_r1

Hi All

I am trying to build the Browser source code downloaded from the
http://android.git.kernel.org/ site
with android-sdk-windows-1.0_r1.
I am getting a lot of compilation errors and it seems that many
classes are missing in 1.0 which are being used by the Browser.

I am stuck into this and not able to figure a way out.
Let me know if I am missing anything.
Waiting desperately 4 a reply.

TIA
--~--~---------~--~----~------------~-------~--~----~

3. recovery, bootloader and diskinstaller

4. Is SDK(r2) support camera capture from desktop devices * (webcams etc). ?

5. Logging to files on the device?

6. Zip inflate failed error while scaning system/app

7. How to Code following logic to make a turning effect of page.