1

I am trying to disable\freeze android hard keyboard from an Android Activity using the following pieces of code.But none is working.

android:configChanges="keyboardHidden" 

in manifest file.

Also inside Activity

Configuration config = getResources().getConfiguration();
        config.hardKeyboardHidden=1;

Please let me know how to disable the hardkeyboard from an Activity in android?

Cœur
  • 37,241
  • 25
  • 195
  • 267
JavaGeek
  • 33
  • 3
  • There are already such questions on Stackoverflow: http://stackoverflow.com/questions/7118810/how-do-i-programmatically-disable-enable-the-physical-keyboard-in-android – Adil Malik Apr 28 '13 at 20:11
  • Check this as well: http://stackoverflow.com/questions/12511140/disable-hard-keyboard-input-for-edittext-in-android – Adil Malik Apr 28 '13 at 20:11
  • I am trying to freeze the keyboard for 3 secs.During which i will show a advertisement.But i am unable to do that.I am searching...i think that's not possible. – JavaGeek Apr 28 '13 at 20:15
  • I'd rather suggest to load the advertisement in an AsyncTask: http://developer.android.com/reference/android/os/AsyncTask.html – Adil Malik Apr 28 '13 at 20:36
  • show progress bar in `onPreExecute()` and hide the progress bar in `onPostExecute(Result)`. While the progress bar is visible, the activity cannot take any input from the user, that means you'll not have to disable the keyboard anymore. Disabling the keyboard is not a good way. – Adil Malik Apr 28 '13 at 20:38

0 Answers0