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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:22:03+00:00 2026-05-23T06:22:03+00:00

I have 15-20 activities in my application. I want when user clicks on the

  • 0

I have 15-20 activities in my application. I want when user clicks on the icon of my app on the homepage and the app is running in the background, user should always see the default screen. However, as per default android behavior users see the last screen that appeared before the application goes in background.
I also do not want to lose the back feature capability. Is there any way to know if user is navigating in the same application or user has switched to other application and coming back to my app.
I know we can use onpause() etc for this kind of thing but I have 15 activities and I want to do this change at one place and do not want to lose back button functionality?

  • 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-23T06:22:03+00:00Added an answer on May 23, 2026 at 6:22 am

    Well in the onPause() of each activity you could either write to a shared preference file if it is the current activity running (and possibly save your backwards stack if you are using one to keep multiple backwards), then in each onResume you could switch intent to the main activity, which could then load up the shared data (either the one piece, or populate an ArrayDeque if you have a stack. ArrayDeque as opposed to Stack, because stack is deprecated, as it is based on the deprecated Vector.)

    That might be a little messy, but might not be too bad (I would have to try it to really know).

    good luck, I hope that helped. If not, I hope someone else can help.

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

Sidebar

Related Questions

I have opened 3 activities. Now the user want to exit the application. for
I have an android application and while switching between two activities I want to
In my Android application I have several activities where the user configures a certain
I'm developing an app that have to be always running and be only closable
I have an application with several activities and I want to be notified when
I have been building a launcher app with many activities. I want the home
As far as I know by default android app resumes when user clicks on
I have an application which has multiple activities associated with it. When the user
In my application I have more that 20 activities and I want to ask
In my application I have several activities, the main screen has 4 buttons that

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.