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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:19:08+00:00 2026-06-05T23:19:08+00:00

I have a problem with the back button that is on my device in

  • 0

I have a problem with the “back” button that is on my device

in my project there are a few layout and class. Let’s call them A, B, C, D.if I run the project starts from the layout “A” and then “B”, “C”, “D”. on my layout position “D” and press the back button found on the device, I would go back to layout “C”, and if pressed again will return to “B” and again to the “A”.

I really want is if I hit “back” on my device, if I was in the layout “D” then I will remain on the layout of “D”. if I was in the layout “C” then I’ll stick to layout “C”.
what should I add?

  • 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-05T23:19:09+00:00Added an answer on June 5, 2026 at 11:19 pm

    In your Activity, you can override onBackPressed and do all the handling you want to do in there. The documentation is available here.

    You’ll need to keep state variables to know where you’re at and what needs to be displayed next when the user press back…

    You can always call super.onBackPressed() when you want to just use the default behavior too (finishing the current activity)

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

Sidebar

Related Questions

I have a problem that appears and disappears for mysterious reasons. A while back
I have a problem. I have a view that is getting back no results
I have problem with fancybox. I want to write a function that will run
I have a problem on going back (clicking the Back button) from sub-activity to
I have a problem returning data back to the function I want it returned
I have been spending some time on this. My problem involves bringing back domain
OSX 10.7, XCode 4. I have a small problem: I need to push back
Okey, this is my problem. I have one service class where Ive managed to
I have a button that onclick reads and shows to the user a list
I have 3 Activities...the first Activity have a button that start third Activity. 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.