Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7944201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:29:06+00:00 2026-06-04T00:29:06+00:00

I am new in android and I have total 6-7 activities in my application.

  • 0

I am new in android and I have total 6-7 activities in my application. I want to know how can I manage my activities properly means when I move to the A->B->C->D like that. Then how can I move that the stack of these activities not created.

On moving from one activity to the other I am using the below code:

Intent intent=new Intent(current.this,next.class);
                startActivityForResult(intent, 0);

And now if I want to move back on the earlier activity I used the code as:

Intent start = new Intent(current.this,next.class);
                    startActivity(start);
                    finishActivity(0);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:29:08+00:00Added an answer on June 4, 2026 at 12:29 am

    Is there a special reason that you don’t want to use the activity stack and let the activities handle themselves?

    The Android system has done a very good job with the activity lifecycle. It allows you to start an Activity from different places without confusing the user because the back button will bring the user back to a different activity.

    If you don’t have a very good reason to not use the Android guideline try to stick to the way the system is doing it. Every other thing will only give you problems.

    You are starting activities for a result but how I understand you you will never return to them.

    You can start an Activity and after that just finish the current Activity. That way the activity will not be put on the back stack. Now you need to listen for back button pushes and create the activities that you want to bring the user to.

    If you want to move from Activity A to D like going to the start/home screen of you app you do the following:

      Intent goBackToA = new Intent(context, StdActivity.class);
      goBackToA.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      startActivity(goBackToA);
    

    The flag FLAG_ACTIVITY_CLEAR_TOP will tell the system that if the backstack contains an instance of the Activity this activity will be shown and all activity that are between the current activity and the target activity are removed from the backstack. This allows you to go back to a home activity without creating huge loops that the user can move through with the back button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am creating a new android application.i am using the table layout. I have
I am new in Android. I have develop an app. And now want to
I am new to Android. I have tried an sample application for status bar
I want to close total application in android when i click on NO Button
(note that I'm a total beginner in android programming) I have a class that
I have to get the time of download in my android application, that's why
I have a Android application and I want to show a progress bar for
hi to all i am new to android i have to send my different
I am a bit new with android but I have some java experience. So
Ok, im fairly new to android but i have managed to teach myself the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.