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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:59:40+00:00 2026-06-17T04:59:40+00:00

I have a custom on-screen back button and I want to make it change

  • 0

I have a custom on-screen back button and I want to make it change to “Hide Keyboard” once the user taps on the EditText of my screen. I found some good code from this question, regarding detecting if the keyboard is open or not (Check out Reuben Scratton’s Old Answer for what I did). I’m at the step in the .java file:

 @Override
public void onSoftKeyboardShown(boolean isShowing) {
    // do whatever you need to do here
}

How would I enter code here for the back button to change it’s image once the keyboard is open?

Here is the code for my back button currently:

    <ImageButton
        android:id="@+id/back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@null"
        android:contentDescription="Back"
        android:scaleType="fitStart"
        android:src="@drawable/back_bar" />

I want to change it to:

 <ImageButton
        android:id="@+id/back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@null"
        android:contentDescription="Back"
        android:scaleType="fitStart"
        android:src="@drawable/hide_keyboard" />

Here is an image of what I’m trying to do in case I don’t make any sense!!
image

  • 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-17T04:59:42+00:00Added an answer on June 17, 2026 at 4:59 am

    You could use :

    ImageButton backButton = (ImageButton)findViewById(R.id.back); 
    backButton.setImageResource(R.drawable.hide_keyboard);
    

    in your onSoftKeyboardShown method

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

Sidebar

Related Questions

In my WebView app I want to have a custom onReceivedError screen. Instead I
I have a custom component that is vertically longer than the screen height and
I have custom classes that I currently instantiate within App.xaml as resources. I want
I have a custom shell script that runs each time a user logs in
I have a listview which I want to display custom data like zodiac Sign
I have a custom UINavigationBar on a screen, i.e., no navigation controller, as defined
I have a view with a custom bar at the bottom of the screen.
I'm trying to create a custom back button, and everything seems to work except
I'm having a problem with custom buttons in jquery mobile. <li><a href=about.php>Button</a></li> I want
I have custom UITableViewCell . It contains UITextLabel . When I press this cell

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.