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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:47:49+00:00 2026-05-29T23:47:49+00:00

Im creating a bundle in one activity, then extracting it in another activity here

  • 0

I”m creating a bundle in one activity, then extracting it in another activity

here is when it’s created in he main activity

//Create bundle to reference values in next class
                Bundle bundle = new Bundle();
                bundle.putInt("ODD", odd);
                bundle.putInt("EVEN", even);
                bundle.putInt("SMALL", small);
                bundle.putInt("BIG", big);
                //After all data has been entered and calculated, go to new page for results
                Intent myIntent = new Intent();
                myIntent.setClass(getBaseContext(), Results.class);
                startActivity(myIntent);
                //Add the bundle into myIntent for referencing variables
                myIntent.putExtras(bundle);

Then when I extract on the other activity

//Extract the bundle from the intent to use variables
    Bundle bundle = getIntent().getExtras();
    //Extract each value from the bundle for usage
    int odd = bundle.getInt("ODD");
    int even = bundle.getInt("EVEN");
    int big = bundle.getInt("BIG");
    int small = bundle.getInt("SMALL");

The application crashes when I’m extracting the bundle on the second activity.
But when I comment out the extraction of the bundle. The app runs fine. So I’ve narrowed it down to that.

My log cat doesn’t really explain what the error is, or i just dont understand it

ideas?

  • 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-29T23:47:50+00:00Added an answer on May 29, 2026 at 11:47 pm

    You are adding below code after calling startActivity(myIntent);

    //Add the bundle into myIntent for referencing variables
                    myIntent.putExtras(bundle);
    

    Put this just before startActivity(myIntent);

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

Sidebar

Related Questions

I'm creating android app that has table layout for the main activity, and that
I want to create layout programmatically in different class which is not an activity
i'm creating custom title for activity by disabling standard one and managing everything myself.
I am creating an android application in which there are two activites. One activity
I am having some difficulty creating a bundle for my application, and placing files
im newbie developer and creating my first iphone app... and i have one little
I am new to iphone development.. am creating one small application where two viewcontrollers
First off I'm new at programming. I'm creating an app with one navigation bar
I am creating an application based on the Utility template. The main screen consists
I am new to android, I am in a completing stage in creating 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.