|
24 | 24 | import android.os.Bundle; |
25 | 25 | import android.os.Environment; |
26 | 26 | import android.os.Handler; |
| 27 | +import android.provider.Settings; |
27 | 28 | import android.util.Base64; |
28 | 29 | import android.util.DisplayMetrics; |
29 | 30 | import android.util.Log; |
|
82 | 83 | /** |
83 | 84 | * Extends NativeActivity to provide interface methods for runtime.cpp |
84 | 85 | * |
85 | | - * @author chrisws |
| 86 | + * @author Chris Warren-Smith |
86 | 87 | */ |
87 | 88 | public class MainActivity extends NativeActivity { |
88 | 89 | private static final String TAG = "smallbasic"; |
@@ -586,11 +587,17 @@ public void onClick(DialogInterface dialog, int which) {} |
586 | 587 | public void showKeypad(final boolean show) { |
587 | 588 | Log.i(TAG, "showKeypad: " + show); |
588 | 589 | final View view = getWindow().getDecorView(); |
| 590 | + final Activity activity = this; |
589 | 591 | runOnUiThread(new Runnable() { |
590 | 592 | public void run() { |
591 | 593 | InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); |
592 | 594 | if (imm != null) { |
593 | 595 | if (show) { |
| 596 | + String id = Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); |
| 597 | + if ("com.sec.android.inputmethod/.SamsungKeypad".equals(id)) { |
| 598 | + String message = getResources().getString(R.string.samsung_keyboard); |
| 599 | + Toast.makeText(activity, message, Toast.LENGTH_LONG).show(); |
| 600 | + } |
594 | 601 | imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
595 | 602 | } else { |
596 | 603 | imm.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
0 commit comments