I have started the ACTION_INPUT_METHOD_SETTING intent which give user the possiblity to activate a softInput (keyboard). I want to close the setting activity(the intent I started) when user activated my desired soft input/keyboard.
Asked
Active
Viewed 1,024 times
3 Answers
1
There is no direct way to determine it - see http://groups.google.com/group/android-platform/browse_thread/thread/1728f26f2334c060/5e4910f0d9eb898a where Dianne Hackborn from the Android team has replied. However, you can detect it indirectly by checking if the window size changed in #onMeasure. See Android: Is software keyboard shown?.

Community
- 1
- 1

arodriguezdonaire
- 5,396
- 1
- 26
- 50
1
I found the answer on this post from Sujay:
You can close all activities from background and when re-open the app It starts from first activity
this.finish();
Intent intent = new Intent(getApplicationContext(), CloseApp.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
You can close all activities from background and when re-open the app It starts from paused activity[where you closed] activity
this.finish();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
0
Try this
InputMethodManager imm = (InputMethodManager)getActivity().getApplicationContext().getSystemService( Context.INPUT_METHOD_SERVICE);
Log.e(TAG, "Result :"+imm.isActive());

Sushil
- 147
- 1
- 9
-
Thanks! I have tried isActive() before. The output from the log is "false" even when the keyboard is working fine, that i do not understand. – Bookan Aug 11 '15 at 07:03
-
By InputMethodManager I can only show the InputMerhodSelection. I can't make it enabled. – Bookan Sep 11 '15 at 09:37