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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:09:39+00:00 2026-06-13T23:09:39+00:00

I have a custom listview adapter which contains two buttons, the problem is it’s

  • 0

I have a custom listview adapter which contains two buttons, the problem is it’s hard to click on the button and it keeps losing focus, or you have to touch it multiple times before it recognizes the click.

@Override
public View getView(int position, View view, final ViewGroup parent) {

    DataEntity data = entityList.get(position);

    view = inflater.inflate(R.layout.new_mission_row, parent, false);

// inflate other views


    Button playButton = (Button) view.findViewById(R.id.buttonPlay);
    playButton.setBackgroundResource(R.drawable.blue_button);
    playButton.setTextColor(Color.WHITE);
    MyClickListener listener = new MyClickListener(context,entity);
    playButton.setOnClickListener(listener);
    playButton = (Button) view.findViewById(R.id.buttonMap);
    playButton.setBackgroundResource(R.drawable.blue_button);
    playButton.setTextColor(Color.WHITE);
    playButton.setOnClickListener(listener);
    return view;
}
  • 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-13T23:09:40+00:00Added an answer on June 13, 2026 at 11:09 pm

    Check your code once. You have not created a different button object for buttonmap.

    playButton = (Button) view.findViewById(R.id.buttonMap);
    

    Here you are using the same button object as you have created for buttonPlay

    Also when your are populating the ListView then you should use the ViewHolder pattern to populate the listview efficiently.

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

Sidebar

Related Questions

I have a custom ListView with two button and I when I click either
I have got ListView with a custom Adapter. Every row contains clickable buttons and
I have a custom adapter for my ListView which has multiple TextViews. I want
Here's my aproach: I have a custom ListView containing a custom Adapter containing two
I have a ListView with custom adapter which is populated from local sqlite database.
I have a ListView with few elements, each item contains two buttons with a
I have a listview which contains custom rows. When I show the listview with
I have a custom ListView Adapter , with which I'm creating rows for a
I have made a custom listView which which extends ListActivity and each row contains
I have a custom ListView adapter which implements an ImageThreadLoader class. Unfortunately, the class

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.