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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:01:31+00:00 2026-05-26T07:01:31+00:00

im trying to send two bundles at once from one activity to another and

  • 0

im trying to send two bundles at once from one activity to another and im having no luck.. i can send a bundle ok but when i try two send two i get a null pointer.
heres my code:

Activity A,
         @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
    //  TextView name = (TextView) v.findViewById(R.id.label2);
        TextView number1 = (TextView) v.findViewById(R.id.label);
        Intent i = new Intent(this, options_Page.class);
    //  Bundle bundle2 = new Bundle();
        Bundle bundle1 = new Bundle();
        bundle1.putString("title", number1.getText().toString());
    //  bundle2.putString("title2", name.getText().toString());
        i.putExtras(bundle1);
    //  i.putExtras(bundle2);
        startActivity(i);

Activity B,
                    Bundle bundle1 = this.getIntent().getExtras();
    //  Bundle bundle2 = this.getIntent().getExtras();
        String title = bundle1.getString("title");
    //  String title2 = bundle2.getString("title2");
        ((TextView) findViewById(R.id.tvnumber)).setText(title);
    //  ((TextView) findViewById(R.id.tvname)).setText(title2);

using this code as it is now it sends one bundle (number) no problem, if anyone knows how i can send the other (name) it would really help me.
Thanks in advance…

  • 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-26T07:01:31+00:00Added an answer on May 26, 2026 at 7:01 am

    You can send more then one bundle but for your need from current scenario you don’t need it, Just use one,

    Try this, there is no need to 2 bundle,

    In activity A,

        Intent i = new Intent(this, options_Page.class);
        i.putExtras("title", number1.getText().toString());
        i.putExtras("number", number2.getText().toString()); 
        startActivity(i);
    

    In activity B,

        String value1 = getIntent().getExtras("title");
        String value2 = getIntent().getExtras("number");
    

    or

    Bundle extras = getIntent().getExtras();
        if (extras == null) {
            return;
        }
        String value1 = extras.getString("title");
        String value2 = extras.getString("number");
    

    Thanks.

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

Sidebar

Related Questions

I'm trying to emit a signal and send two parameters, one is a list
I'm trying to send a byte[] (using PUT) with Restlet but I can't find
I have two web pages that I am trying to send information between. One
I'm trying to send data from client socket to the server but, when data
Trying to send a complex type between two systems that have the same code
I'm trying to send information from a form and a hidden email variable (from
I am trying to send email using Exchange 2007 from a console app using
I am trying to send an email from a Ruby program. The smtp server
I am trying to send the output from the find command to OpenSSL in
I'm trying to send e-mails from my localhost, using my gmail account, I've looked

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.