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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:55:36+00:00 2026-06-13T17:55:36+00:00

I am using ListView in my activity. on any list item seleted(ID) it should

  • 0

I am using ListView in my activity.
on any list item seleted(ID) it should display the entire row(associated with ID), in another activity.
I used bundle object to pass the long value using “putExtra”. but that did not work either. may I know how could I get it done.?

1st activity :

Bundle dataBundle = new Bundle();
dataBundle.putLong("ID",id);

Intent myIntent = new Intent();
myIntent.setClassName("com.mink7.databaseapplication", "com.mink7.databaseapplication.OnItemClickFromLV");
myIntent.putExtras(dataBundle);
startActivity(myIntent);

2nd activity :

Bundle extras = getIntent().getExtras(); 

if(extras !=null)
{
    long idd = extras.getLong("ID",0);
    Cursor c=db.getName(idd);
    final String name_ret = c.getString(c.getColumnIndex("name"));
    final int age_ret = Integer.valueOf(c.getString(c.getColumnIndex("age")));
    final String city_ret = c.getString(c.getColumnIndex("city"));
    t1.setText(name_ret);
    t2.setText(age_ret);
    t3.setText(city_ret);
}
  • 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-06-13T17:55:38+00:00Added an answer on June 13, 2026 at 5:55 pm

    Just add the long directly, like intent.putExtra("ID",value) the extras are already a key value pair. Then the code for receiving the values on your second activity should be working.

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

Sidebar

Related Questions

I have a ListView that opens another activity when an item row is clicked
I am using a ListView in an Activity class. I'm not using any XML
I am using Expandable ListView example found on net Activity: public class ExpandableListViewActivity extends
here i am using an activity in which there is a list view,which I
I am using listview to display three textviews(values for these text views where come
Is there any way creating a photo gallery using Listview control ? Im playing
I have a listview where each list item can contain 1 or more clickable
i am using following code to display list of tags now when i select
I have a listview activity in which I set the selector color using the
I have a list activity, and I chose to manually add the first item

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.