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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:23:08+00:00 2026-05-20T10:23:08+00:00

I read with interest user sunit ‘s answer to this question about updating an

  • 0

I read with interest user sunit‘s answer to this question about updating an EditText’s hint but have been unable to find any documentation on using the method that I presume he appears to describe there: using the <selector> element in an XML layout to dynamically adjust attributes of an EditText at runtime when the element is focused/unfocused.

In my case I am actually more interested in adjusting the android:inputType element (because the hint disappears for me when the inputType is specified) but adjusting the hint would work just as well.

To be clear I know how to make this change in Java code–I’m trying to find out if there is a way to specify the behavior in XML. 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-05-20T10:23:09+00:00Added an answer on May 20, 2026 at 10:23 am

    I’m afraid it isn’t yet possible. <selector> is only valid to be applied in making state lists out of Drawable and Color resources, it does not yet work for Strings.

    With regards to your mention of adjusting android:inputType to make the hint disappear, this is actually a known Android bug that will eventually be fixed in later versions so I wouldn’t recommend building your code around this functionality as it will break when they fix it:

    http://code.google.com/p/android/issues/detail?id=13895

    Since you mentioned that you already know how to do this in the Java code, I won’t point out how to call setHint() from within a OnFocusChangeListener 😉

    Cheers.

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

Sidebar

Related Questions

Read about the issue in this stackoverflow question . Still have the same issue
I read this question in stackoverflow. The excerpt answer provided by bbum is below:
I read an article about a regular expression to detect base64 but when I
I read the Avoiding Memory Leaks article with interest, and am concerned about danging
This is a pretty stale question but frankly I'm yet to find it answered
I read with interest this post to StackOverflow: How to Make a Basic Finite
This is confusing me: As far as I have read, a view with setVisibility(View.GONE);
I have a major interest in writing a database management system. Having read a
I read with interest the post How universally is C99 supported ?. One of
I've read with interest the post C difference between malloc and calloc . I'm

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.