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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:39:57+00:00 2026-06-10T00:39:57+00:00

I got a custom ListView which I fill with an Adaptar. During my application

  • 0

I got a custom ListView which I fill with an Adaptar. During my application the items within the list will change according to their status so I’m updating my ImageViews like so:

mStatusIcon = (ImageView) findViewById(R.id.imgStatusIcon);
mStatusIcon.setImageResource(R.drawable.icon_cancel);

So far so good. The problem is that I want some kind of focus/hover state on a certain part of my layout. I’ve set up an OnTouchListener() on my View mHitfield in my layout xml.

I can catch all the relevant actions: ACTION_MOVE, ACTION_DOWN, ACTION_UP and ACTION_CANCEL.

The problem is that when I change my ImageView mStatusIcon the next action I catch is always ACTION_CANCEL.

View mHitfield = (View) findViewById(R.id.outerShape);

mHitfield.setOnTouchListener(new OnTouchListener() 
{

    @Override
    public boolean onTouch(View v, MotionEvent event) 
    {

        int currentAction = event.getAction();

        switch(currentAction)
        {
            case MotionEvent.ACTION_DOWN:   
            case MotionEvent.ACTION_MOVE:

                // if I comment out these lines I keep receiving all actions
                // if I don't, I only receive ACTION_DOWN followed by ACTION_CANCEL
                mStatusIcon.setImageResource(R.drawable.icon_download_normal);
                break;

            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL: 

                // if I comment out these lines I keep receiving all actions
                // if I don't, I only receive ACTION_DOWN followed by ACTION_CANCEL
                mStatusIcon.setImageResource(R.drawable.icon_download_hover);
                break;
        }

        return false;
    }
});

Can somebody explain to me why this is happening and if there is a way to work arround this?

  • 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-10T00:39:58+00:00Added an answer on June 10, 2026 at 12:39 am

    I’m still not really sure why it happened but it was seems the TouchEvent was canceled because the layout was updated within the custom View created. Once I didn’t use a custom View but created a XML Layout instead the problem ceased to exist.

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

Sidebar

Related Questions

I've got a ListView with a custom BaseAdapter. The list items contain CheckBoxes that
I've got a custom drawable resource to display my items in a ListView, actually
I got a custom listview which contains info about tv shows, ie. show title,
I've got a ListView that is populated using a custom BaseAdapter (MyBaseAdapter) : public
I got a custom Data type named Student which has marks for 2 subjects.
I've got a custom collection which adds functionality to the 'ArrayList' class. Here's some
I created a user control which contains a ListView with a custom ItemsPanelTemplate. <UserControl
I've got a ListView with a custom adapter, and I'm trying to modify the
i got the following problem. i have a ListView with custom rows consisting of
I've got a ListView with a 'show next results' button. The list is filled

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.