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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:50:24+00:00 2026-06-14T22:50:24+00:00

Some element is stealing the focus, and the clicks on my listview don’t register.

  • 0

Some element is stealing the focus, and the clicks on my listview don’t register.
Can someone suggest a way to find which?

Here is how the app works:

Activity > inner custom View > onTouch > AlertDialog.builder.setView(custom ListView)

I mistakenly thought I needed two choices, and used with total success the same setup, using .setPositiveButton and .setNegativeButton on the builder before. But I need more choices, therefore a ListView.

Here are the relevant lines from the ListView:

final ListView lv = new ListView(this);
lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, names) {
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) { convertView = new TextView(GameActivity.this); }
    ((TextView)convertView).setText((String)getItem(position));
    return convertView;
  }
  public long getItemId(int position) { return position; }
  public String getItem(int position) { return names[position]; }
  public int getCount() { return names.length; }
});                     
lv.setOnItemClickListener(new OnItemClickListener() {
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  ///////Nothing happens, never called
  }
}); 

I read twenty or thirty stack overflow posts, it almost always has something to do with a view stealing the focus.
Which view is stealing the focus, how can I debug this?

Thanks! 🙂

  • 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-14T22:50:25+00:00Added an answer on June 14, 2026 at 10:50 pm

    The answer is in Sam’s comment: it simply worked, and I wasn’t dismiss()ing the dialog.

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

Sidebar

Related Questions

Is there any way to encapsulate an Iframe with some other element to simulate
How can we set element to some default date in mysql ? In oracle
My JS-code has array arrayResults , some element of him can be undefined -
I have some element which click on it event triggers click on <input style=display:none
I'd like to build a function, which, given a 2D matrix and some element
I have a complex structure xml from which I need to read some element
Is there a way in jquery to target $(this) . some element above it
I create some element by jQuery. Those elements are draggable and resizable. I can
What is the simplest way too check is some element presence to array? I
I have a method which is called onClick of some element. In that function

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.