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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:23:27+00:00 2026-06-12T00:23:27+00:00

I have got a cool image (fancy with rounded corners). I want to implement

  • 0

I have got a cool image (fancy with rounded corners). I want to implement that image in my android app. When clicked on it, I want it to darken a bit (like a button when pressed) and launch a new activity.

How can I do that and what should I use (ImageView, ImageButton or just Button) ?

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

    You’ll require two version of your cool image call it as active.png (clicked state i.e darken a bit) and inactive.png (normal state).
    in the drawable folder create a Selector file for them as follows
    Like : /drawable/cool_button_selector.xml

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    
        <item android:state_pressed="true" android:drawable="@drawable/active"/> 
        <item android:drawable="@drawable/inactive"/>
    
    </selector>
    

    and then user the ImageButton like this:

    <ImageButton
        android:id="@+id/coolImageButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/cool_button_selector"
        android:background="@null" />
    

    Added: android:background=”@null” to <ImageButton>

    Hope this helps 🙂

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

Sidebar

Related Questions

Have got an NSString *str = @12345.6789 and want to find out if there
I have got a suggestion to restrict an Android application to be installed a
I've got a 16 pixel high image that I've created in Paint.NET that I'd
I have a bunch of forms that have various input elements. I want to
I have a bunch of forms that have various input elements. I want to
I've got a Regex question, I have to recognize tokens in a text that
Since I've got into ASP.NET I have found loads of really cool features, which
I have got the requirement to find the core file in multiple box/machine and
I have got this code: function init(){ if (typeof window.jQuery !== 'function') { var
I have got a form into which information is entered, and a drop down

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.