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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:41:04+00:00 2026-05-26T03:41:04+00:00

i have a problem in using intents there are 5 activities in the application

  • 0

i have a problem in using intents
there are 5 activities in the application
the natural flow of passing intent extras is A–>B–>C–>D–>E

however depending on a condition , C may or may not be started
when C is not started, i want to start D from B directly
this time D will require data from A and B

if C is started it adds some intent extra and starts D
(D needs extras from A,B and C)

currently i have 2 make 2 copies of D to receive intents like this

is there a way wherein i can have a single copy Of D, which wil start depending on whether it is instantiated by either B or C
or D should obtain that extra intent which is put by C?

i m a complete noob to android,any workaround or solutions welcome please..
thanks !!

  • 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-26T03:41:04+00:00Added an answer on May 26, 2026 at 3:41 am

    Put an extra flag , to decide which activity is calling D. check this flag when you start the activity D and if you get call from C look for extras passed form C, otherwise ignore them.

    in activity B.

    Intent i = newIntent(context, D.class);
    i.putExtra(“fromC”, false);
    startActivity(i);

    in activity C:

    Intent i = newIntent(context, D.class);
      i.putExtra("fromC", true);
      // add more extras.
      startActivity(i);
    

    in activity D:

    boolean fromC = getIntent().getBooleanExtra("fromC");
      if (fromC) {
          // read extras that have been passed from C.
      }
    

    HTH.

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

Sidebar

Related Questions

i have problem using camera in my Android application i have a form for
I have problem while using jquery maskedinput with asp.net textbox. I have a check
I have a problem using the Java search function in Eclipse on a particular
I have a problem using Linq to NHibernate to load an object and eagerly
I have a problem using the SSIS. I try to import data from database
I have a problem using JSON and arrays. Here is my code: while($row =
i have a problem using the Catch Clipboard Events code found on this link
Greetings, I have a problem using jqgrid and jquery tab (I am coding in
I have the following problem using subversion: I'm currently working on the trunk of
I have the following problem using template instantiation [*]. file foo.h class Foo {

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.