Hi friends I have an editable text box with a default value like to display to the user like "entername". If the user touches the edit box, I want to clear the value of edittext box and show the virtual keypad to the user, and if the user presses the enter key, only in the edit text box, I have to start anothe开发者_Go百科r activity. How do I do this?
Hi in android:hint at the type of key pressing only it clear value I want to on touch in edit text box clear value and show virtual keypad to user. How do I do this?
Thanks
What?
I really don't understand what you're asking, but it seems like you might be trying to do a hint
? Rather than setting an onTouchEvent listener, add a android:hint="What to do"
attribute to your EditText.
U use the following code EditText EditTextName=findViewById(R.id.EditText01);
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(EditTextName), 0);
use this code in ontouchListener of EditText
Mohan if I am correct you have two questions here
- How to display a hint in an edit box
- How get some data from a web service
For the first question you can use android:hint="Enter Name"
For the second one you need to give us more info on what you are trying to do
精彩评论