From 5c7f57c2b26c152f3c9352dc84ff77a16681de2a Mon Sep 17 00:00:00 2001 From: ricky barrette Date: Mon, 26 Apr 2010 16:37:19 +0000 Subject: [PATCH] in onCreate() i added a line that should hide the soft keyboard untill the user clicks on the dice EditText. Note: it works on the emulator, but not my phone. --- .../TwentyCode/android/ExaltedDice/ExaltedDice.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java index 4fa29d7..be2ce61 100755 --- a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java +++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java @@ -15,6 +15,7 @@ import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; +import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; @@ -377,7 +378,14 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic // rollDice(); // } // }); - + + /** + * hide keyboard + * + * works on the emulator + */ + ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(dice.getWindowToken(), 0); + /** * display hello message */