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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:56:17+00:00 2026-06-03T02:56:17+00:00

I have 2 activities A and B, A starts B. I start activity B

  • 0

I have 2 activities “A” and “B”, “A” starts “B”. I start activity “B” with startActivityForResult() method. When “B” is in foreground and home button is pressed app goes to background. And when I try to launch app again it starts with activity “A”, not “B”. Result for activity “B” is cancelled.
Why “B” is closed?
I thought that using launchModes in manifest can solve the problem but documentation says that I can’t use singleTask and singleInstanse modes becouse the result will be cancelled and activity will not start.

How can I solve this?

PS
Thanks for answers, problem is solved. I tried to use finish() in onStop(), so when activity “B” is in foreground and home button is pressed, it finishes.

  • 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-03T02:56:17+00:00Added an answer on June 3, 2026 at 2:56 am

    Start your activity B with an intent, using the method startActivity(Intent).

    Your intent should be created with the arguments A.this and B.class, resulting in code looking somewhat like this:

    Intent i = new Intent(A.this, B.class);

    A.this.startActivity(i);

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

Sidebar

Related Questions

I have 3 Activities...the first Activity have a button that start third Activity. The
I have a series of activities in my application which starts with Activity A
suppose that you have 3 Activities (A, B and C) and Activity A starts
I have an Android App with a number of activities. The wrong activity is
I have some Activities, activity A in which I start new activity B in
I have tab activities (tab1, tab2). When button1 is pressed in tab1 activity it
I have a simple problem. In my app I have 3 activities A,B,C. Activity
I have three activities, A, B and C. User can start activity B from
I have total 3 activities. First activity(A) starts second activity(B). From Activity B, 3rd
I have weird problem with HOME button. I have two activities A and B.

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.