I added that line to my activity, and I still get the virtual keyboard after the return key is pressed. Pressing the return key only adds a new line to my EditText. Did I implement it improperly? Here is a sample piece of code testing the functionality:
public class Login extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
EditText usernameEditText = (EditText)findViewById(R.id.usernameVal);
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(usernameEditText.getWindowToken(),
0);
}
}
Thanks,
Dan
On Apr 7, 2010, HeHe <[email protected]> wrote:
//the keyboard now
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(v.getWindowToken(),
0);
On Apr 7, 10:09 am, [email protected] wrote:
> Hello,
> Is there a way to configure the virtual keyboard to "hide" once the return key is pressed? I have numerous EditText fields in my application and I want the user to be able to enter a single line value, press return, and the keyboard goes away.
> Is there a way to override the virtual keyboard return key?
> Thank you very much!
> Dan
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.

