我的启动程序类名是"SplashScreen“。我有两个活动"MainActivity“和"MenuList”。当用户打开应用程序时,SplashScreen活动就会启动。启动屏幕活动验证并启动MainActivity。用户通过单击MenuList屏幕上的按钮打开MainActivity活动,并单击MenuList活动中的home按钮。当用户打开应用程序时,它应该直接打开MenuList活动。我已经做了如下链接中提到的变化。当用户按下MainActivity中的主页按钮时,它工作正常。当用户按下MenuList活动中的主页按钮时,它无法工作。请帮帮我。
https://stackoverflow.com/a/20815679/1517280
ScreenFlow: SplashScreen -> MainActivity -> MenuList
舱单代码:
<activity
android:name=".SplashScreenActivity"
android:clearTaskOnLaunch="true"
android:launchMode="singleTask"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait" />
<activity
android:name=".MenuList"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait" />
发布于 2017-06-19 12:02:38
从SplashActivity的元素中删除android:clearTaskOnLaunch="true"
。
实际上,这也不适用于您的MainActivity --因为设置了此标志,每次回到应用程序时,任务的堆栈都会被清除,SplashActivity也会被启动。
https://stackoverflow.com/questions/44629886
复制相似问题