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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:48:01+00:00 2026-05-17T20:48:01+00:00

I have a custom listview row that contains a number of textView components. Instead

  • 0

I have a custom listview row that contains a number of textView components. Instead of the “standard” single text item, I have created a item where each listview row contains several bits of information. For this example, I have a record id, a name, and a description for each row in the listview.

I have my listview populated via

this.mDbHelper = new RecordDBAdapter(this);
this.mDbHelper.open();
Cursor c = this.mDbHelper.fetchAllRecords();
startManagingCursor(c);

String[] from = new String[] {RecordDBAdapter.ROW_ID, RecordDBAdapter.NAME, RecordDBAdapter.DESCRIPTION};

int[] to = new int[] {R.id.recordId, R.id.lblName, R.id.lblDescription};

// Now create an array adapter and set it to display using our row
SimpleCursorAdapter records =  new SimpleCursorAdapter(this, R.layout.record_row, c, from, to);

this.list.setAdapter(dives);

Now what I want is to be able to access the recordId value within each clicked item. I’ve tried to follow the Android tutorials to no avail. They do something like

Object o = adapter.getItemAtPosition(position);

but that still doesn’t help either. What I REALLY want is to get the value of the recordId WITHIN each selected listItem. Does anyone know how this would be accomplished? Here is my onItemClick event:

     protected OnItemClickListener onListItemClick = new OnItemClickListener()
        {
            @Override
            public void onItemClick(AdapterView<?> adapter, View view, int position, long rowId) {

// My goal is either to grab the value of the
// recordId value from the textView, or from the adapter.
                //Object o = adapter.getItemAtPosition(position); //Tried this, no joy
                Intent intent = new Intent(NeatActivity.this, SomeOtherActivity.class);             
        //      intent.putExtra("selectedRecordId",val); //val here is a numerical record row id being passed to another activity.
                startActivity(intent);
            }       
        };
  • 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-17T20:48:01+00:00Added an answer on May 17, 2026 at 8:48 pm

    You’re trying to do too much out of the default adapter class. You need to write your own adapter class, extend simplecursoradapter, and then you can make any method you want to get whatever you want at any position you want.

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

Sidebar

Related Questions

I have a custom control template for a ListView that puts an extra line
Basically, I have a custom ListView in which each item looks like: <LinearLayout> <Table>
I have a custom control that is derived from ListView . This list view
So I have a custom ListView object. The list items have two textviews stacked
I'm trying to create a check/uncheck all CheckBox for a number of CheckBoxes that
I'm working on an application, and I have a screen that in my mind,
I want to create a layout in such a way that on top edittext
I've been looking everywhere to see if there is a standard way of achieving
OLD QUESTION (Already answered by Mark - The answer is to use getTag()): Let's
Working in C# win forms, I'm trying to create a list of items where

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.