Try removing category.DEFAULT from the launcher activity - I think it's
getting in the way.

-- Kostya

2011/6/20 jeyaprakash chinaraj <[email protected]>

> hi Kostya,
>
>  i set everything pls have look at below code
>
>      My *FirstActivity*
>
>          <activity android:name="com.android.test.LauncherActivity"
>  android:label="@string/app_name" android:clearTaskOnLaunch="true">
> <intent-filter>
>  <action android:name="android.intent.action.MAIN" />
> <category android:name="android.intent.category.DEFAULT"></category>
>  <category android:name="android.intent.category.LAUNCHER" />
> </intent-filter>
>  </activity>
>
> * Second Activity*
> *
> *
> <activity android:name=".SecondActivity" > </activity>
>
> *Intent to launch Second Activity from service*
>
>                 Intent screen = new Intent(getApplicationContext(),
>  SecondActivity.class);
> screen.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>  screen.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
> screen.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
>  getApplicationContext().startActivity(screen);
>
>
>
>
> On Mon, Jun 20, 2011 at 5:48 PM, Kostya Vasilyev <[email protected]>wrote:
>
>> Try setting clearTaskOnLaunch on the launcher / home activity (which I
>> assume is FirstActivity).
>>
>> 2011/6/20 Jey <[email protected]>
>>
>>> Hi Kostya,
>>>
>>>              i tried with FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET but
>>> still my second activity comes foreground , i have a service with two
>>> activities
>>>
>>>
>>>    FirstActivity--> myService--> secondActivity
>>>
>>>
>>>  I finish() the secondActivity in backclick ,
>>>
>>> when i using home button to launch my app , my second activity comes
>>> foreground again i want to start my first activity
>>>
>>>
>>> On Jun 20, 4:11 pm, Kostya Vasilyev <[email protected]> wrote:
>>> > You can try clearTaskOnLaunch in the <activity> or finishTaskOnLaunch
>>> for a
>>> > particular activity.
>>> >
>>> > You can also try FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET.
>>> >
>>> > Home screen shortcuts are launched with FLAG_ACTIVITY_NEW_TASK |
>>> > FLAG_ACTIVITY_RESET_TASK_AS_NEEDED, I'd recommend read up on them
>>> first.
>>> >
>>> > -- Kostya
>>> >
>>> > 2011/6/20 Jey <[email protected]>
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > > I want to Remove top activity from display stack ,
>>> > > FLAG_ACTIVITY_CLEAR_TOP helps me to do this but not in all cases,
>>> this
>>> > > flag helps when i Manually launch a particular activity and removes
>>> > > top activity from stack ,But when i bring my application from Home
>>> > > Screen , by default top activity only displayed How can i launch a
>>> > > particular activity from Home ?
>>> >
>>> > > --
>>> > > 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
>>>
>>> --
>>> 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
>>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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