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 7875781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:03:24+00:00 2026-06-03T03:03:24+00:00

When you press the back button while in an activity, by default, does the

  • 0

When you press the back button while in an activity, by default, does the application not go back to the activity that called it? I am calling an activity in my application(call it Activity B), from Activity A, but when I hit the back button while in Activity B, I am taken back to the main page of the application.

So I guess in general, does pushing the back button on your phone take you to the calling activity?

Calling activity B from within an inner class of activity A:

    class HeadlineButtonListener implements OnClickListener {

    private Story story;

    public HeadlineButtonListener(Story story) {
        this.story = story;
    }

    @Override
    public void onClick(View v) {
        Intent myIntent = new Intent(HeadlineBoard.this, StoryView.class);
        myIntent.putExtra(Constants.STORY_EXTRA, story);
        HeadlineBoard.this.startActivity(myIntent);
        finish();

    }
}
  • 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-03T03:03:24+00:00Added an answer on June 3, 2026 at 3:03 am

    You call finish() on first activity after firing the next activity, this will cause it to be removed from the activity stack, just remove the call to finish():

    @Override
    public void onClick(View v) {
        Intent myIntent = new Intent(HeadlineBoard.this, StoryView.class);
        myIntent.putExtra(Constants.STORY_EXTRA, story);
        startActivity(myIntent);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible that my activity is not destroyed when i press the back
I try the code below to call another activity while pressing the back button:
When I press the back button, while my app's running, the onPause method gets
Just need a little bit of Javascript to warn people that press the back
I have a simple game activity. I start it and than press the back
My MAIN activity is spawning a child activity that contains a ListView . While
this is my flow navA-> navB->navC then when user press NavC back button he
I'm trying to make a regular button that functions like a toggle button, but
When I press F5, everything compiles fine, but when the app is to be
when we press on the Home button two times then we see the all

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.