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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:51:18+00:00 2026-05-22T17:51:18+00:00

I have this Selector defined: <selector xmlns:android=http://schemas.android.com/apk/res/android> <!– PRESSED –> <item android:state_pressed=true android:drawable=@drawable/backarrow_blueshiny />

  • 0

I have this Selector defined:

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- PRESSED -->
    <item android:state_pressed="true"
          android:drawable="@drawable/backarrow_blueshiny" />

    <!-- FOCUSED --> 
    <item android:state_focused="true"
          android:drawable="@drawable/backarrow_blackshiny" />

    <!-- DEFAULT -->
    <item android:drawable="@drawable/backarrow_blackshiny" />

</selector>

and it’s used with this button:

    <RelativeLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:background="@drawable/bottomborder_glossy">

        <!-- BACK -->
        <ImageButton
        android:id="@+id/filter_button_back"
        android:layout_width="90dip" 
        android:layout_height="wrap_content" 
        android:src="@drawable/selector_back_button"
        android:background="#00000000"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"/>

    </RelativeLayout>

and the onTouch event consists of:

public boolean onTouch(View v, MotionEvent event)
{
    final int actionPerformed = event.getAction();
    final int widgetID = v.getId();

    if (actionPerformed == MotionEvent.ACTION_UP)
    {
        switch (widgetID)
        {
            case R.id.filter_button_back:
            {
                this.finish();
                break;
            }

        }

    }

    return false;
}

what this button does is exit the current activity this.finish()
However, in my testing the button doesn’t always switch to “backarrow_blueshiny” – namely when pressing very fast.

So the problem is that the selector fires slower than the onTouch(MotionEvent.ACTION_UP) event.

Is there anything I can do to make sure that the selector isn’t “laggy” ?

  • 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-05-22T17:51:19+00:00Added an answer on May 22, 2026 at 5:51 pm

    Do you mean laggier than the typical Android selector behavior? In my experience, there’s always been a slight delay between a button press, and it being selected — I assume it’s to avoid showing a touch event when you’re just wanting to scroll, but it’s always annoyed me. If it’s more than the typical behavior, try using just a button, with the android:background set to the selector, rather than an ImageButton with the android:src set to the selector.

    e.g.

    <Button
        android:layout_width="90dip"
        android:layout_height="wrap_content"
        android:background="@drawable/selector_back_button"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true" 
        />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following selector defined in an XML file under res/color/redeemlist_item_color.xml : <?xml
I have this selector: $(table.details tbody tr:not(.details)) But I'm wondering why this inner table
Does anyone have any idea what this jQuery selector will do? object.find('td:eq(1) div div');
Example: I have a selector like this, which I give to another method as
I have this line in a javascript block in a page: res = foo('<%=
I have defined a ImageButton as being drawn by a selector (which uses several
I have an interface defined like this @interface PageViewController : UIImageView { ... }
I have defined my own function, like this: jQuery.fn.createSelector = function(){ var element =
I have an object defined like this: Scores.h: @interface Scores : NSObject { NSString
I have this code in jQuery, that I want to reimplement with the prototype

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.