On Wed, Aug 22, 2012 at 10:00 AM, Carlos A. M. dos Santos
<[email protected]> wrote:
> On Wed, Aug 22, 2012 at 9:23 AM, user123 <[email protected]> wrote:
>> I want to detect exactly when the user says, hey, let's open the app, and
>> taps on the app's icon, not anything else. Is this hard to understand?
>
>         @Override
>         public void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 Intent intent = getIntent();
>                 boolean fromLauncher = savedInstanceState == null &&
>                 Intent.ACTION_MAIN.equals(intent.getAction()) &&
>                 intent.getCategories().contains(Intent.CATEGORY_LAUNCHER) &&
                   (intent.getFlags() &
Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0;

Might help too.

-- 
"The flames are all long gone, but the pain lingers on"

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to