Alex Rivera | Logout

Alternative to Intent.FLAG_ACTIVITY_CLEAR_TASK

Asked 2012-06-19T09:37:17.947
34

I have two apps App-B launches App-A. If the user starts App B from inside App A I call finish on App-A so I have no problem.

If the user goes straight to App B from the Application drawer or long pressing home button then I implement the below which clears the task in App A first before applying all the extras. This has the desired affect but only works on API 11. On lower APIs the new task in APP-A will not change and extras putExtra will have no effect. Any alternative to FLAG_ACTIVITY_CLEAR_TASK? for API <=10?

        Intent i = new Intent("com.App-A");
    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);

Thanks

Jason

Edit
Report

1 Answer

1

The best documentation I've found for these Intent flags is here: http://blog.akquinet.de/2010/04/15/android-activites-and-tasks-series-intent-flags/

I don't understand what you are trying to do, but have you tried FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET?

answered 2012-09-29T00:23:26.617

Your Answer