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

  • Home
  • SEARCH
  • 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 4121316
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:20:09+00:00 2026-05-20T23:20:09+00:00

I have scoured SE and google and found what I thought were decent examples

  • 0

I have scoured SE and google and found what I thought were decent examples of how to implement putExtra() in tandem with getStringExtra().

The trouble I seem to be unable to resolve is that my putExtra data never appears to be getting retrieved from my getStringExtra call in the target activity.

I’ve tried numerous SE examples where others have asked this question countless times and yet it never seems to get me closer to a working base to expand on.

My primary activity’s put is as follows;
(First, I tried this with no luck)

    // Click handler for group list items
    lvGroups.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            int gid       = groupIds.get(arg2);
            Intent intent = new Intent(RadSMS_Activity.this, RadSMS_CreateGroup.class);
            intent.putExtra("SELECTED_GROUP_ID", gid);
            startActivity(intent);
            finish();
        }
    });

(Then, I tried this. Also with no luck.)

    // Click handler for group list items
    lvGroups.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            int gid       = groupIds.get(arg2);
            Intent target = new Intent();
            target.putExtra("SELECTED_GROUP_ID", gid);
            Intent intent = new Intent(RadSMS_Activity.this, RadSMS_CreateGroup.class);
            startActivity(intent);
            finish();
        }
    });

My target activity that I want to extract the value from is the following;

    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.creategroup);

        String strGID = getIntent().getStringExtra("SELECTED_GROUP_ID");
        selectedGID = new Long(strGID);
        // ... additional code would be here
    }

Function truncated for brevity’s sake.

So, according to everything I’ve seen so far, it appears I’m doing it right, but when I put a breakpoint at the line where selectedGID gets assigned its value, strGID is always null. This is really beginning to make me crazy.

Can anyone please tell me if I have done something incorrect?

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

    gid is an int.
    You are putting an int.
    You appear to be trying to retrieve a string.
    Consider:

    int gid= getIntent().getIntExtra("SELECTED_GROUP_ID",-1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really have scoured Google for a similar question and found nothing, which confuses
I have scoured for 2 hours now across the internet, I have found courses
I have scoured stackoverflow and other forums including the google maps v3 api docs
I have scoured the forums and Google trying to figure out what I am
Ok. I have scoured for hours. I can't seem to find the answer to
I have scoured the web for a decent explanation of the routing syntax in
I have scoured the help files for Visual Studio and could not locate any
I have scoured the internet to find which CMS's run on CloudSites and the
I have scoured the net for this question and have came up empty handed.
I've scored the internet for sources and have found a lot of useful information,

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.