Quantcast
Channel: Removing an activity from the history stack - Stack Overflow
Browsing latest articles
Browse All 18 View Live

Answer by Nouman Ghaffar for Removing an activity from the history stack

It's too late but hope it helps. Most of the answers are not pointing into the right direction. There are two simple flags for such thing. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |...

View Article



Answer by Rowland Mtetezi for Removing an activity from the history stack

It is crazy that no one has mentioned this elegant solution. This should be the accepted answer. SplashActivity -> AuthActivity -> DashActivity if (!sessionManager.isLoggedIn()) { Intent intent =...

View Article

Answer by user8269411 for Removing an activity from the history stack

Just call this.finish() before startActivity(intent) like this- Intent intent = new Intent(ActivityOne.this, ActivityTwo.class); this.finish(); startActivity(intent);

View Article

Answer by Anubhav for Removing an activity from the history stack

In the manifest you can add: android:noHistory="true" <activity android:name=".ActivityName" android:noHistory="true" /> You can also call finish() immediately after calling startActivity(..)

View Article

Answer by Stanislaw Brzezinski for Removing an activity from the history stack

Just set noHistory="true" in Manifest file. It makes activity being removed from the backstack.

View Article


Answer by Smiderle for Removing an activity from the history stack

I use this way. Intent i = new Intent(MyOldActivity.this, MyNewActivity.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK) startActivity(i);

View Article

Answer by Alécio Carvalho for Removing an activity from the history stack

Try this: intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) it is API Level 1, check the link.

View Article

Answer by mxcl for Removing an activity from the history stack

One way that works pre API 11 is to start ActivityGameMain first, then in the onCreate of that Activity start your ActivitySplashScreen activity. The ActivityGameMain won't appear as you call...

View Article


Answer by alphonzo79 for Removing an activity from the history stack

I know I'm late on this (it's been two years since the question was asked) but I accomplished this by intercepting the back button press. Rather than checking for specific activities, I just look at...

View Article


Answer by Travis for Removing an activity from the history stack

This is likely not the ideal way to do it. If someone has a better way, I will be looking forward to implementing it. Here's how I accomplished this specific task with pre-version-11 sdk. in each class...

View Article

Answer by Aitor Gómez for Removing an activity from the history stack

You can achieve this by setting the android:noHistory attribute to "true" in the relevant <activity> entries in your AndroidManifest.xml file. For example: <activity...

View Article

Answer by Matthias for Removing an activity from the history stack

Yes, have a look at Intent.FLAG_ACTIVITY_NO_HISTORY.

View Article

Answer by Daniel Lew for Removing an activity from the history stack

You can use forwarding to remove the previous activity from the activity stack while launching the next one. There's an example of this in the APIDemos, but basically all you're doing is calling...

View Article


Removing an activity from the history stack

My app shows a signup activity the first time the user runs the app, looks like: ActivitySplashScreen (welcome to game, sign up for an account?) ActivitySplashScreenSignUp (great, fill in this info)...

View Article

Answer by ricky for Removing an activity from the history stack

Removing a activity from a History is done By setting the flag before the activity You Don't want A->B->C->DSuppose A,B,C and D are 4 Activities if you want to clear B and C then set...

View Article


Answer by eagerprince for Removing an activity from the history stack

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { super.finishAndRemoveTask(); } else { super.finish(); }

View Article

Answer by Aparna Juhi for Removing an activity from the history stack

Here I have listed few ways to accomplish this task:Go to the manifest.xml- and put android:noHistory="true", to remove the activity from the stack.While switching from present activity to some other...

View Article

Browsing latest articles
Browse All 18 View Live




Latest Images