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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:05:19+00:00 2026-06-13T05:05:19+00:00

I have some ImageView ‘s: The selector for right arrow button is: <?xml version=1.0

  • 0

I have some ImageView‘s:

The selector for right arrow button is:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="3" android:state_pressed="true"/> <!-- pressed -->
    <item android:drawable="1" android:state_enabled="false"/> <!-- enabled -->
    <item android:drawable="2"/> <!-- default -->

</selector>

(1, 2, 3 look like the ones in the picture below — 1 is for left arrow button, but the right’s one looks like the same with opposite direction).

Now my problem is:

  1. When the user does click, I use setEnable() to change its status. It works.
  2. When the user does long click, again, I use setEnable() to change its status. But after the user released his finger, the button retains status as image #3.
  3. I tried: cancelLongPress(), clearFocus(), invalidate(), post(Runnable), postInvalidate(), refreshDrawableState()… but they didn’t work.

The app uses minimum SDK 4 (Android 1.6). Could you help me?

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-13T05:05:20+00:00Added an answer on June 13, 2026 at 5:05 am

    Temporary solution:

    ...
    imageView.setOnTouchListener(new View.OnTouchListener() {
    
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_UP) {
                v.postDelayed(new Runnable() {
    
                    @Override
                    public void run() {
                        v.setEnabled(...);
                    }// run()
                }, 200); // 200 ms is enough
            }
    
            return false;
        }// onTouch()
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following layout: <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical android:background=#EAEAEA>
I have some problem with my relative layout code : <?xml version=1.0 encoding=utf-8?> <RelativeLayout
I have imageView with some frame imageView.frame = CGRectMake(0,0, 100, 100); imageView.contentMode = UIViewContentModeScaleAspectFit;
I have a ImageView and draw some things on that view. Now I want
I have listview having customized some textview and one imageview. When I long click
I'm pretty new to Android but I have some experience (and a bit rusty
I have a parent LinearLayout in which has some ImageView s, now I set
I have some video files.I need to show every video file as a ImageView
I have some code that creates a popup and assign it an XML layout
Here're some view controller I have: tabBarController , navigationBarController , viewController , and imageView

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.