You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Runningactivities (mostrecentfirst):
TaskRecord{45a6662 #208A=com.tencent.mmU=0sz=4}
Run #3: ActivityRecord{c04e6f1u0com.tencent.mm/.plugin.setting.ui.setting.SettingsFontUIt208}
Run #2: ActivityRecord{8fa53acu0com.tencent.mm/.plugin.setting.ui.setting.SettingsAboutSystemUIt208}
Run #1: ActivityRecord{9c0eebdu0com.tencent.mm/.plugin.setting.ui.setting.SettingsUIt208}
Run #0: ActivityRecord{d29fc3au0com.tencent.mm/.ui.LauncherUIt208}
Step 2
Runningactivities (mostrecentfirst):
TaskRecord{477c03b #214A=com.tencent.mmU=0sz=1}
Run #2: ActivityRecord{44c7cbeu0com.tencent.mm/.ui.LauncherUIt214}
TaskRecord{45a6662 #208A=com.tencent.mmU=0sz=2}
Run #1: ActivityRecord{d29fc3au0com.tencent.mm/.ui.LauncherUIt208f}
Run #0: ActivityRecord{c04e6f1u0com.tencent.mm/.plugin.setting.ui.setting.SettingsFontUIt208f}
Step 3
Runningactivities (mostrecentfirst):
TaskRecord{477c03b #214A=com.tencent.mmU=0sz=1}
Run #1: ActivityRecord{44c7cbeu0com.tencent.mm/.ui.LauncherUIt214}
TaskRecord{45a6662 #208A=com.tencent.mmU=0sz=1}
Run #0: ActivityRecord{c04e6f1u0com.tencent.mm/.plugin.setting.ui.setting.SettingsFontUIt208f}
Step 4
Runningactivities (mostrecentfirst):
TaskRecord{477c03b #214A=com.tencent.mmU=0sz=1}
Run #0: ActivityRecord{44c7cbeu0com.tencent.mm/.ui.LauncherUIt214}
行为
使用
adb shell dumpsys activity activities
命令查看 activities 在任务栈变化,改进版命令:
adb shell dumpsys activity activities | sed -En -e '/Running activities/,/Run #0/p'
(多谢前辈 @liuxing917738 指导)测试机型:Nexus 5 (6.0.1)
Task Stack 变化
Step 1
Step 2
Step 3
Step 4
各 Activity 清单文件如下:
TL;DR : 各 Activity LaunchMode 如下:
LauncherUI :singleTop
SettingsFontUI:standand
SettingsAboutSystemUI:standand
SettingsUI:standand
已实现的方案
在 SettingsFontUI 界面中捕获点击 back 键事件,加入如下代码:
修改 font scale 代码:
当 LauncherUI 启动时,直接读取 font scale 并在 onCreate 方法中设置即可。
分析
疑问
在新 Task 中启动主界面,然后把旧 Task 中 所有 Activity 全部结束,这是如何做到的?
The text was updated successfully, but these errors were encountered: