KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to hide the softkeypad in android when user click on anywhere other than a Edittext. There are many help for iphone but not for android. I tried this code but its not working :( final RelativeLayout base = (RelativeLayout) findViewById(R.id.RelativeLayout1); findViewById(R.id.base).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(base.getWindowToken(), 0); } }); Thanks in advance !
Tags (comma-separated)
Save Edits
Cancel