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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:05:19+00:00 2026-05-23T13:05:19+00:00

So I am trying to launch a new activity after the item in a

  • 0

So I am trying to launch a new activity after the item in a list is selected…. pretty basic based on what I’ve read. I am also trying to send a value in the extras. So I can select the item in a list, and the new activity starts, extras is set, but the value in the extras is empty. I’ve noticed the id of the intent on the new activity doesn’t match the one from the 1st activity. I don’t know if it is supposed to or not.

From Activity 1:

public void onItemClick(AdapterView<?> parent, View view,
              int position, long id) {
                  Intent displayIntent = new Intent(getApplicationContext(), DisplayActivity.class);
              int index  = _names.indexOf(((TextView) view).getText());
              displayIntent.putExtra("ID_TAG", ids.get(index));
              startActivity(displayIntent);
          }

In Activity2 (DisplayActivity)

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bundle extras = getIntent().getExtras(); 
        _hiveIndex = extras.getLong("ID_TAG");
}

Any Ideas why I wouldn’t be getting the value? The mMap under the extras is set to a hash map before in the 1st intent, but is null in activity2.

  • 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-23T13:05:19+00:00Added an answer on May 23, 2026 at 1:05 pm

    displayIntent.putExtra(“ID_TAG”, ids.get(index)) of Activity1 not using Bundle object,to put Bundle object you need to use putExtras(Bundle bundle) method instead of it.Since you are trying to get the Bundle object in Actvitiy2. Your passing other than Bundle object in Activity1 putExtra method,but you trying to get the Bundle object in Activity2 for that reason your are getting nothing.
    displayIntent.putExtra(“ID_TAG”, ids.get(index));replace with
    displayIntent.putExtras(your bundle object);

    Or you can use getIntExtra(String name, int defaultValue) method.

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

Sidebar

Related Questions

I am trying to launch a new intent after I have loaded data. I
I'm trying to do something rather simple here, just launch a new activity from
I'm trying to launch a website url in a new tab using python in
I'm trying to launch an activity , when i got an incoming call for
I'm new to the Map View implementation in Android. I'm trying to launch a
I am simply trying to launch an activity from a button but when I
I am crashing trying to launch a sub-activity. I have a small app to
I am trying to launch a MapActivity from Activity using intent. Following is how
Hey, I've come across a strange problem. I'm trying to launch an activity that
I'm trying to launch the configured email client on android to send an attachment.

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.