mohan
mohan

Reputation: 13165

Edit text view issue

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 another 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

Upvotes: 1

Views: 825

Answers (3)

Ravi Vyas
Ravi Vyas

Reputation: 12375

Mohan if I am correct you have two questions here

  1. How to display a hint in an edit box
  2. 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

Upvotes: 0

Pinki
Pinki

Reputation: 21929

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

Upvotes: 0

Kevin Coppock
Kevin Coppock

Reputation: 134684

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.

Upvotes: 3

Related Questions