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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:17:53+00:00 2026-05-15T13:17:53+00:00

I have two activities: a MainListActivity, and a DetailViewActivity. DetailViewActivity is set with android:launchMode=singleTop

  • 0

I have two activities: a MainListActivity, and a DetailViewActivity. DetailViewActivity is set with android:launchMode="singleTop".

When clicking an item in the “main list” activity, it launches the “detail view” activity via:

startActivityForResult(detailIntent, REQUEST_CODE_DETAIL);

If I then call setResult(RESULT_OK, resultData); and finish(); from within the Detail activity, that resultData is received by the “main list” activity’s onActivityResult(..) method correctly.

However, if I implement a “see previous”/”see next” type of navigation within the Detail activity, and implement it using singleTop, that result no longer gets sent back to the initial activity:

Intent nextItemIntent = this.createIntent(nextId);
nextItemIntent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
startActivity(nextItemIntent);
// at this point, my DetailActivity's onNewIntent() method is called, and the new data is loaded properly

But from here, when I call setResult(..) and finish(), my MainList activity never receives the new/updated result.

Anyone know what I’m doing wrong?

  • 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-15T13:17:54+00:00Added an answer on May 15, 2026 at 1:17 pm

    Bah… my mistake. Looks like the problem was FLAG_ACTIVITY_FORWARD_RESULT. Apparently that flag is not needed when using FLAG_ACTIVITY_SINGLE_TOP and onNewIntent(..).. So by setting FLAG_ACTIVITY_FORWARD_RESULT, I was actually telling Android to forward my result data one activity farther back on the stack (activity before MainListActivity).

    I removed that flag, and it now works as expected:

    Intent nextItemIntent = this.createIntent(nextId);
    nextItemIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    startActivity(nextItemIntent);
    

    And all is well.

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

Sidebar

Related Questions

I have two activities. The first activity display list of the users with short
I have created two activities say A and B. Activity A lists list of
I have two Sharepoint lists: - Assignments - Activities The activities list has a
I have two activities or screens. The second activity has an AlertDialogBox with radiobuttons
Say I have two Activities in an Android application, EditPerson and EditEmployee . It
I have two activities, activity 1 and activity 2 for example. Activity 1 will
I have two Activities that both list items in a table. For the time
In my project I have two activities or classes. In first activity I have
I have two activities in which I need to pass an object array between
I have two Activities: one with VideoView attached to MediaPlayer and the second one.

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.