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

  • Home
  • SEARCH
  • 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 962399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:30:02+00:00 2026-05-16T01:30:02+00:00

I am using some tweaks that allow the user to change the UI of

  • 0

I am using some tweaks that allow the user to change the UI of my application with ressources from their SDCard. That’s really easy and nothing special, I just use the “setImageDrawable” or “setImageBitmap”.

http://developer.android.com/reference/android/widget/ImageButton.html

That’s really cool and all my users are happy to customize the UI.

But now, I would like to also change the pressed/focused ressource of the button!

Now, when they click on it, they cannot see anything and they click maybe 10 times. And more problematic, that’s not really intuitive.

So i would like to change also the pressed/focused state programmatically…

Ani idea suggestion?

  • 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-16T01:30:02+00:00Added an answer on May 16, 2026 at 1:30 am

    You’ll have to make all of your ImageButtons have a StateListDrawable instead of BitmapDrawables.

    ImageButton ib = new ImageButton(this);
    StateListDrawable sl = new StateListDrawable();
    sl.addState(new int[] { android.R.attr.state_enabled }, yourDefaultDrawableHere);
    sl.addState(new int[] { android.R.attr.state_pressed, android.R.attr.state_selected }, yourImageDrawableHere);
    ib.setImageDrawable(sl);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using some time expiring url to watch a video from internet and so,
I am using a linux system and need to experiment with some permissions on
Sorry, I know that this topic has been covered a bit. I've read the
a C++ noob here. I am trying to tweak some code, with the following
I read once that git commit messages should be in the imperative present tense,
I'm working on a console based file browser for Windows in C++ and am
I want to use three20's TTThumbsView & TTPhotoView to build something like Grindr. Instead
I'm developing an app (basically an intranet) which has a few small sets of
I'm a member of a small but fairly sociable online forum, and just for
I started occupational programming with Delphi when the Turbos came out , and have

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.