Tag

TaskStack

0 views collected around this technical thread.

Sohu Tech Products
Sohu Tech Products
Dec 22, 2021 · Mobile Development

In-depth Source Code Investigation of FLAG_ACTIVITY_NEW_TASK Causing Activity Launch Failure

This article analyzes why adding the FLAG_ACTIVITY_NEW_TASK flag can prevent an Android Activity from starting, examines the underlying framework source code—including startActivityInner, getReusableTask, recycleTask, and complyActivityFlags—and provides practical solutions to resolve the launch failure.

ActivityAndroidFLAG_ACTIVITY_NEW_TASK
0 likes · 18 min read
In-depth Source Code Investigation of FLAG_ACTIVITY_NEW_TASK Causing Activity Launch Failure
Tencent Music Tech Team
Tencent Music Tech Team
Jun 2, 2016 · Mobile Development

Ensuring a Single Instance of the Main Activity in Android Using a Dispatcher Activity

To guarantee a single persistent main Activity while allowing sub‑Activities and third‑party navigation, the article proposes routing all external and internal launches through a dedicated DispatcherActivity that uses FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TOP, a static weak reference, and onNewIntent handling, avoiding singleTask/instance modes.

ActivityAndroidDispatcher
0 likes · 14 min read
Ensuring a Single Instance of the Main Activity in Android Using a Dispatcher Activity