android guy
android guy

Reputation: 108

which is better way for activity launch mode , manifest or intent flags

Which is better way for activity launch mode? manifest or intent flags ? which is better than other ? and why ? I am asking here in terms of performance. I am currently following android developer site tutorial.

Upvotes: 1

Views: 1260

Answers (1)

Raghav Sood
Raghav Sood

Reputation: 82563

Both are equal in terms of performance, but serve different purposes.

If you always want an Activity to show a particular kind of behaviour (let's take Being excluded from recent tasks for an example), then you will set the property in the <activity> element corresponding to that Activity in the manifest.

However, if you only want to exclude it from recent tasks under certain conditions, like when launching it from a Pending Intent via a notification or the AlarmManager, then you set the flag to exclude it from recent tasks in the Intent and not the manifest, so that it is still present in recent tasks under other situations, like being navigated to from within the app.

Upvotes: 6

Related Questions