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

The Archive Base Latest Questions

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

in my app i use list view. in the list view i have three

  • 0

in my app i use list view. in the list view i have three image buttons(play,detail,buy). each image button has individual actions. how can i perform onclick action for each image button in list view.

my code:

public class AndroidThumbnailList extends ListActivity{
      ..........
   public class MyThumbnaildapter extends ArrayAdapter<String>{
      public MyThumbnaildapter(Context context, int textViewResourceId,String[] objects) {
       super(context, textViewResourceId, objects);
            // TODO Auto-generated constructor stub
       }
      public View getView(int position, View convertView, ViewGroup parent) {
           .........
      }
   }


   public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
    _contentUri = MEDIA_EXTERNAL_CONTENT_URI;
    initVideosId();
  setListAdapter(new MyThumbnaildapter(AndroidThumbnailList.this, R.layout.row, _videosId));
  }



}

how to write action for my list view. please help me.

  • 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-23T00:19:45+00:00Added an answer on May 23, 2026 at 12:19 am

    You will need to write your own Adapter that inflates the view you want to use, and then assigns an OnClick listener to each of the images. Here is some sample code from one of my projects that does something similar (but with a single checkbox that I add a listener to).

    public class GroupListAdapter extends BaseAdapter {
    
    private List<Group> groups;
    
    // ... constructors here
    
    @Override
    public int getCount() {
        return groups.size();
    }
    
    @Override
    public Group getItem(int position) {
        return groups.get(position);
    }
    
    @Override
    public long getItemId(int position) {
        return position;
    }
    
    @Override
    public View getView(final int position, View convertView, final ViewGroup parent) {
        final Group group = getItem(position);
    
        final View view;
        if (convertView == null)
            view = LayoutInflater.from(parent.getContext()).inflate(R.layout.group, null);
        else
            view = convertView;
    
        view.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                // do stuff when the rest of the view is clicked
            }
        });
    
        TextView tv = (TextView) view.findViewById(R.id.group_name);
        tv.setText(group.getName());
    
        final CheckBox check = (CheckBox) view.findViewById(R.id.group_checkbox);
        check.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                // do stuff when clicked
            }
        });
    
    
        return view;
    }
    

    }

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

Sidebar

Related Questions

in my app i have a list view. Each list consists of a image,
I have one listView in my app, which i is use to list the
In a ASP.NET MVC 4 app I have a view with a paged list
I have a list view in my RoR web app. The view is a
I have a navigation based app. Press a button on main view, then I
In my app I have four fields and each of them is list of
I have a Django app that use a django-tagging. I need to port this
I have a console command line app that use NHibernate . I am trying
I am trying to create an app that has a list of users and
I have a listview where each list item can contain 1 or more clickable

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.