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. Predefined styles

Hello!

I'm trying to figure out what style the text under the application shortcuts 
in the launcher uses. Is it a different style for each phone model or is 
there some style I cen reuse to get the same looking text in a widget?

:.:: mattias

-- 

2. (WTA) MyTouch Music

Numpang nanya..dulu sy pernah pake htc wildfire ada aplikasi mytouch music
yg bisa denger music online.ada yg punya link nya bisa di share gan.makasih

-- 
===============

3. How to detect the task initiated by touching a button in the kernel?

4. Change View

5. partner_setup command not found.

6. HTC Desire 2?

7. [WTA] Tanya provider yang bagus untuk daerah depok ciracas