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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:57:46+00:00 2026-06-06T23:57:46+00:00

Sometimes I notice that, for a View v – v.hasWindowFocus()==false – ((View)v.getParent()).hasWindowFocus())==true If I

  • 0

Sometimes I notice that, for a View v

 - v.hasWindowFocus()==false
 - ((View)v.getParent()).hasWindowFocus())==true

If I understand the docs correctly, this should never be the case.

v.getParent() is a (subclass) of ListView

Any ideas on what might be causing this?

Note: I assume this hasWindowFocus-mismatch is the root cause for this issue

  • 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-06T23:57:48+00:00Added an answer on June 6, 2026 at 11:57 pm

    The main reason is that ListView doesn’t like an adapter having an array of views.

    So the problem is triggered by code like

    public View getView (int position, View convertView, ViewGroup parent)
    {
        return _views[position];
    }
    

    When looking at the ListView code (or rather it’s parents AbsListView.obtainView method) you’ll see code like

        if (scrapView != null) {
            ...
            child = mAdapter.getView(position, scrapView, this);
            ...
            if (child != scrapView) {
                mRecycler.addScrapView(scrapView);
    

    It can happen that getView(position,...) is called with scrapView != _views[position] and hence scrapView will be recycled. On the other hand, it is quite likely that the same view is also added again to ListView, resulting in views getting weird states.

    This should be fixed in ListView IMO.

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

Sidebar

Related Questions

I notice that sometimes when I try to override a CSS rule, browser does
am working on a java(tomcat) app. that sometimes writes to stdout. But I notice
I noticed, that sometimes (especially where mod_rewrite is not available) this path scheme is
While browsing the code of some websites I sometimes notice that some JavaScript files
I notice that sometimes audio files on the internet have a fake URL. http://garagaeband.com/3252243
When it comes to adding gems/plugins I notice that sometimes the author name is
I've used resharper for a while now and i notice that it sometimes adds
I sometimes notice programs that crash on my computer with the error: pure virtual
I notice that sometimes when clicking around the map, the map tiles get highlighted
When working with breakpoints in Eclipse I sometimes notice that they have different icons

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.