For example, an Android program contains two activity, mainactivity and otheractivity,mainactivity for program-initiated activity. If the program is located in Otheractivity, click the Home button, the program returns to the desktop,
In the second click of the program icon, the program will automatically restart by default, that is, to re-enter mainactivity, rather than enter the time to click the Home button in the otheractivity of the program.
Workaround:
Modify in Androidmanifest.xml, Mainactivity launchmode, remove android:launchmode= "singletask" boot mode can be.
Configuration code for Androidmanifest.xml
<application android:icon = "@drawable/ic_launcher" Android:label = "@string/app_name" Android:theme = "@style/appthem E "> <activity android:name =". Mainactivity " Android:label =" @string/title_activity_main "> & lt;intent-filter> <action android:name= "Android.intent.action.MAIN"/> <category Android:name= "Android.intent.category.LAUNCHER"/> </intent-filter> </activity> & Lt activity android:name = ". Otheractivity " Android:label =" @string/title_activity_other "Android:launch Mode= "Singletask" > </activity> </application>
Reprint: http://blog.csdn.net/xunyi_hz/article/details/8012445
Running Android program, press the home key to return to the desktop, click on the program icon at the time to avoid restarting the program solution again