I need my deep link activity is launched with flags FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TASK on launching from deeplinks.
The idea is to clear all existing activities and start a new one.
Is this possible with android:lauchMode parameter?
Try this
Intent i = new Intent(mContext, MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
or
android:launchMode="singleTask"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.