Android - How To Start The Exact Same Activity Every Time The App Is Opened Up?
Solution 1:
You might look at the android:clearTaskOnLaunch activity attribute from the Manifest file : http://developer.android.com/guide/topics/manifest/activity-element.html
I think setting this attribute to "true" on your root activity does what you want.
Solution 2:
I would think the solution to be destroying Activity1 and Activity2 onStop. This leaves the stack with only your StartActivity. You can call the finish method in Activity to terminate it programmatically at anytime.
Solution 3:
Generally the way it works (from what I understand) is you use the BACK button to EXIT the activity, and the HOME button will essentially "minimize" the activity - bringing you back to whatever activity was left open.
While you should leave this functionality the same, you can override the home button to completely exit your application.
Solution 4:
In your mainfest.xml file write like this.
<activityandroid:name=".StartActivity"android:label="@string/app_name"android:clearTaskOnLaunch="true"><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity>android:clearTaskOnLaunch="true" attribute automatically restart the activity.
Solution 5:
Just add the below code into your manifest file into the activity whichever you want t open on start.
<intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter>
Post a Comment for "Android - How To Start The Exact Same Activity Every Time The App Is Opened Up?"