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. Why Android Why???

The reason I'm posting in the Developer's forum is because I couldn't
find a single collective and official discussion forum - and also in
hopes that someone high up on that ladder will actually get to review
my concerns (big hopes yeah) - Moderator - if this is too
inappropriate for this forum - please guide me to a suitable one.

I'm at a loss for words regarding Android manufacturers - I think all
they want to do is make money.

Don't get me wrong - I'm not saying Google (via Android) just wants to
make money - I'm talking about HTC, Samsung, LG, etc etc...

These "manufacturers" want to compete with Apple's iPhone - we all
know this - it's the core element that keeps them manufacturing. But
why{*filter*}us around? I'm not trying to be cynical - I'm just trying to
be realistic.

1. I've used Apple's devices, namely, iPhone (3GS & 4) and the iPad -
and to my dismay - the hardware did not disappoint - the software
however did - I can't express how much I despise the iOS platform it
makes my teeth grind that it even exists. I used the iPhone 3GS for
one night and I couldn't stand the device.

2. I've used an Android device - Samsung Galaxy S and Samsung Galaxy
Tab - and couldn't get enough. The device integrates so seamlessly
with your google account it makes using either your PC or your Android
device a seamless experience altogether. I've experienced much better
accuracy when typing, especially on the Samsung Galaxy S compared to
that of ANY iOS device. Obviously this has been contested as there are
some reports that say typing on Android's touchscreens is a hassle
compared to the iPhone or iDevices for that matter - and in my
experience that's a load of bull. One reason - haptic feedback.

So Android as a software platform - brilliant - apart from the
seamless integration with your google account - it's just the UI
that's such a pleasure. Just having a home button (like Apple's junk)
might make you feel that's all you need - but after using Android,
you'll come to find that your Settings, Home - and Return button make
any mobile device {*filter*}y comfortable to use. It just speeds up your
entire movement and collaboration with the device.

Now that we've got that out the way - I can firmly pull my head out
Android's @$$ - let's get to the problem - the manufacturers.

They all want to rival Apple's iPhone. They're all looking for the
iPhone killer - maybe not Android fans as a whole - but the
manufacturer's would like nothing more than to beat Apple's devices to
a pulp.

But why? Why oh Why oh Why? Can't you design a cellphone to match the
exact specifications of the Apple iPhone? Now I anticipate a lot of
hate speech toward me regarding this - and I accept that some of you
may be angry but hear me out.

Why does Apple create their devices the way they do? What is it about
their design that Apple Fanboys find so fascinating? There's three
answers I can't give, among others that may exist.

1. Size: Look at Apple's iPhones - you don't see Apple making them
bigger, or thicker, or wider - Apple goes smaller every time - but not
so much that it makes the device feel cheap or insignificant. You want
a solid device and Apple has maintained that with regard to physical
design.

But Android? Yes sure, you get your Xperia X10 Mini's - but that
device feels like a friggin toy! It's too damn small! Yes sure you get
your Samsung Galaxy S - but still - the few millimeters added onto the
length actually does make a difference, and with the thickness at such
a minimum - it makes the device feel so delicate and awkward.

2. Symmetry: What makes typing on the Apple iPhone and Samsung Galaxy
S such a comfortable, convenient pleasure? Symmetry! Apart from the
screen - you have what I'm going to refer to as the "little black
pieces" that make up the rest of the phone - and these exist at the
top and bottom - i.e. succeeding the top and bottom of the screen.
With such symmetry it allows you to type so much more comfortably
without any offset on how your two hands are holding the device - this
is so important and hardly any Android manufacturer's stick to this
code - make the bottom and top little black pieces after the screen
the same size! MAKE THE BACK AND FRONT SEAMLESS - DON'T HAVE A LITTLE
CAMERA LENS STICKING OUT THE BACK OR A TRACKBALL OR EVEN SO MUCH AS A
BUTTON STICKING OUT! Those things get in the way.

3. Consistency: Apple makes one device - solid (f******* crappy
software) - but nonetheless a perfect piece of hardware - and this
hardware is so consistent it maintains it name for an entire year.
Android manufactures? They each make 10 {*filter*}y phones - and none of
them are consistent - either this one has a track ball on it or this
one has a camera lens sticking out its' {*filter*}y backside - or this one
has a crappy processor or what more? what more? Give us a consistent
device - stop manufacturing hundreds of useless devices and then you
go and release a dual core 2 months later? How the f**** do you expect
us to get our monies worth when you keep bringing sh!t out!? How does
Apple's iPhone still maintain a significant share of the Mobile OS
market - when you {*filter*} blokes have about 30 phones out there
(excluding all the non-branded Chinese Android devices) ???
CONSISTENCY - YES THIS IS AN IPHONE - ITS SO EASY TO SWITCH FROM THE
IPHONE 3 TO THE IPHONE 4 - BECAUSE IT HAS SEAMLESS CONSISTENCY!

BUT LOOKY LOOKY AT THE SAD ANDROID USER - OH NO - MY GOOGLE NEXUS HAD
A TRACKBALL AND NOW THE SWITCH TO THIS SAMSUNG GALAXY S IS A BIT TOUGH
BECAUSE IT DOESN'T HAVE THE TRACKBALL - DAMN I SHOULD HAVE KEPT THIS
IN MIND WHEN WASTING THAT MONEY I WORKED MY @$$ OF FOR! DAMN YOU
MANUFACTURERS! DAMN YOU!

- Well, I think I've made my point - and I hope that manufacturers
will consider not sucking us dry for cash and actually do a good job
of designing their devices - this is not hate speech - it's a humble
plea (maybe not so humble) - I love the Android platform it's such a
pleasure - but come on - I honestly think manufacturers are giving
Android a terrible name.

HTC - I expect much more from you - you are by far the most
fashionable manufacturer - but what are you trying with the Androids?

Samsung - Uhm - hello - you plastic-loving freaks!

LG - keep on reaching you'll get there eventually - one day - you'll
be able to call yourselves cellphone manufacturers.

Regards,


JasunX

-- 

2. ContentObserver and BroadcastReceiver

Hi,

(Note: might be a silly question...)

I have an application which has data related to a ContentProvider. The 
ContentProvider's content is updated from time to time and a ContentObserver 
seems like a good choice to know about these updates.

Is there a way to have a have a cross between a ContentObserver and a 
BroadcastReceiver so that the application doesn't need to be running and yet 
when content is updated a broadcast is created?

Regards,
Julius.

-- 

3. How to use sdcard with android source code compiled?

4. [WTA] sbf 2.2.1 untuk Motorola Droid1

5. New 15 min refund policy - are users aware?

6. met kenal... ijin mendarat...

7. Setting Wallpaper