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

The Archive Base Latest Questions

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

I have total 3 activites. I pass the data from the first activity like

  • 0

I have total 3 activites. I pass the data from the first activity like this:

 Intent i = new Intent(getApplicationContext(), History.class);
        i.putExtra("day", mDay);
        i.putExtra("month", mMonth+1);
        i.putExtra("year", mYear);
        startActivity(i);

get the data:

Bundle extras = getIntent().getExtras(); 
    if(extras !=null) { .......

now I pass the data from the second activity:

Intent i = new Intent(getApplicationContext(), History.class);
                i.putExtra("Hday", mDay);
                i.putExtra("Hmonth", mMonth);
                i.putExtra("Hyear", mYear);
                startActivity(i);

and get the data from the second activity:

Bundle extras2 = getIntent().getExtras(); 
    if(extras2 !=null) {

So, I have extras to get the data from the first activity, and extras2 to get the data from the second activity. But when I pass the data from any activity both extras are not null!
What have I done 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-26T03:40:49+00:00Added an answer on May 26, 2026 at 3:40 am

    The problem is that your third activity has no way of knowing which activity sent the bundle. You need to add a field that identifies what type of bundle this is so you can process accordingly. For instance, in activity 1:

    Intent i = new Intent(getApplicationContext(), History.class);
            i.putExtra("activity", (int)1);
            i.putExtra("day", mDay);
            i.putExtra("month", mMonth+1);
            i.putExtra("year", mYear);
            startActivity(i);
    

    Then in 3rd activity:

    Bundle extras = getIntent().getExtras(); 
        if(extras !=null) { 
           int typeAct = extras.getInt("activity");
           if (typeAct == 1) {
    .......
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have total 3 activities. First activity(A) starts second activity(B). From Activity B, 3rd
I have this code: public class Chronom extends Activity { Chronometer mChronometer; ProgressBar progre;
I have this query to fetch the total OrderStatus that have values 1 and
I have a rails app that uses heavily js (over 1MB total). I'd like
I have two SQL queries, where the first one is: select Activity, SUM(Amount) as
i have made an app that would calculate numbers from input fields. **main Activity
I have a State machine workflow. State Machine workflow requires EventDriven activity , This
I would like to add talkPrice, textPrice and dataPrice and have the total be
I Have a request for the TOTAL's and subtotals column to be moved to
I have an embedded webserver that has a total of 2 Megs of space

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.