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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:48:58+00:00 2026-05-26T16:48:58+00:00

Given a listview with many data fields per row, how can we separate only

  • 0

Given a listview with many data fields per row, how can we separate only one field (say an id) from the row withonClickListener()

public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
                Object dataRow = listView.getItemAtPosition(position);
                Log.e("hi, this is the full row of data, i just want 1 of the fields", dataRow);
            }
  • 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-26T16:48:59+00:00Added an answer on May 26, 2026 at 4:48 pm

    This can be achieved by custom listview by extending BaseAdapter to a class.. In the class you can

    Inside oncreate :

        listview.setAdapter(new newListview(this);  //listview is the object of ListView in xml file              
    

    outside onCreate and newListview is the innerclass for the activity

        class newListview extends BaseAdapter{
        private Context context;
    
    
        public PrayerList(Context context) {
        this.context=context;
    
    
        }
    
        @Override
        public int getCount() {
            // TODO Auto-generated method stub
    
                 return 0;// here return size of listview
        }
    
        @Override
        public Object getItem(int arg0) {
            // TODO Auto-generated method stub
            return null;
        }
    
        @Override
        public long getItemId(int arg0) {
            // TODO Auto-generated method stub
            return 0;
        }
    
                 @Override
        public View getView(final int position, View view, ViewGroup viewgroup) {
    
    
                ViewHolder holder = null;
                LayoutInflater inflater =  LayoutInflater.from(context);
             if (view == null) 
             {
    
                 view = inflater.inflate(R.layout.mydatalistview, null);
                holder = new ViewHolder();
                holder.txtViewTitle = (TextView) view.findViewById(R.id.title);
                holder.txtViewDescription = (TextView) view.findViewById(R.id.description);
                holder.arrowImage=(ImageView)view.findViewById(R.id.arrow_imageview);
                view.setTag(holder);
             }
             else
             {
                 holder = (ViewHolder) view.getTag();
             }
                  view.setOnClickListener(new OnClickListener() {
    
                     @Override
                     public void onClick(View v)
                     {
                                     //here you can use onclick of particular item of listview
                               }
    
                 }
         class ViewHolder{
    
        TextView txtViewTitle;
        TextView txtViewDescription;
        ImageView arrowImage;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one give me the difference between Itemsource and DataContext of Listview in
I'm trying to have a ListView that will display each row in a given
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
I have a listview which is populated by a SimpleCursorAdapter that is binding data
Given a populated ListView , how do I iterate through each bound template and
I have a listview where each list item can contain 1 or more clickable
I have two ObservableCollections and I need to show them in one ListView control
Currently my ListView is filling up with the given String[] but I wanted to
I have a ListView in virtual mode, and the underlying data is being stored
This is my problem. I have a ListView , each row is a CheckedTextView

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.