Search code examples
androiduser-interfaceandroid-toastinformation-hiding

How to add a little 'information' button to my Android application


I'm not too sure if this has not already been answered as I feel this question is hard to pose concisely, well I found it difficult anyway.

What I want is, for example, I have an EditText, and the prompt may make sense for some people (the little hint) but I feel that for others, they may need a little more explanation/or an example.

So I would like a little round "i" button representing information next to the EditText. What I desire this button to do, is, once touched, is to kind of bring up a toast window, displaying my desired help information.

I think you can picture the functionality I'm taking about, just from user experience! But I cannot seem to find a great way of doing this, the way I'm imagining.

Now, if there is already a clear example of this somewhere that you know of, a link would be fantastic, if not, some code with some explanation would be fantastic. I am new to java and android development, but I'm getting there, slowly but surely.

Thank you very much, once again for any help, or tips!


Solution

  • Get an image of the i that you want. Add an image view to your layout, and use that image in it. Set a onClickListener for that ImageView, and have that listener launch the toast you want to display.