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

  • SEARCH
  • Home
  • 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 3691072
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:06:23+00:00 2026-05-19T04:06:23+00:00

In my application after the user goes from one activity to another and vice

  • 0

In my application after the user goes from one activity to another and vice versa. Im calling the activities using Intents on the event “onClick”.

public void onClick(DialogInterface dialog, int whichButton) {
                    Intent intent = new Intent();
                    intent.setClass(Field.this,Boll.class);
                    startActivity(intent);
                    finish();
                }

After using the application when the back button is pressed then application must end and should go back to the Home screen.

However what happening in my app is, when the Back button is clicked the activities are still in the stack and are traced back one by one(i.e to their previous state), and finally returns back to the Home Screen.

I have learned that Android takes care of quitting the application, from here

Please let me know where should i add the finish() in order to finsh all activities in the stack and go back to Home Screen(i.e to end the application).

  • 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-05-19T04:06:23+00:00Added an answer on May 19, 2026 at 4:06 am

    You should try adding the noHistory attribute to your activities

    http://developer.android.com/guide/topics/manifest/activity-element.html#nohist

    You shouldn’t manually handle the stack. There is no way to “finish” all the activities in an application. Android is designed to pick the application up where it left off. Making the “back” button close out of the app instead of closing the current activity could be very confusing and frustrating to your users.

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

Sidebar

Related Questions

Suppose user has opened my web application in many different browser windows. After sometime
I have an application where I need the user to upload a photo. After
I've a application that must work after another application. This second application has a
I'm developing a LoB application in Java after a long absence from the platform
I am using the Redirect After Post pattern in my ASP.NET MVC application. I
How to make check box that allow user to run application after installation?
I get this error when debugging my ASP.NET web application after I trigger an
I'm trying to debug a deadlock in a multi-threaded Python application after it has
I'm writing a direct3d application and after noticing strange bugs such as anti-aliasing occurring
I've been tasked with debugging a Java (J2SE) application which after some period of

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.