On 19/04/11 11:49, Akshay Kulkarni wrote:
Hi,
Am trying to detect if the soft keyboard is active from the ImputMethodManager, and the piece of code is as below ;
InputMethodManager imm = (InputMethodManager)getActivity().getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
Log.e(TAG, "Result :"+imm.isActive());
But the above displays the result as "true" always.
Is there any way to find if the keyboard is active?
Thanks in advance.
Akshay
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
-- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
>> android:windowSoftInputMode=adjustPan
>> <activity name="EditContactActivity"3) I found one way.
>> android:windowSoftInputMode="stateVisible|adjustResize">
>> ...
>> </activity>
--
I need this feature too. In an IME I'd like to use hardware keys, as example volume up and down keys for say to navigate through the text. But if ime is not being used, the keys must be passed through to be handeled further.
The Android platform comes with codecs for e.g. MP3 and AAC and sometimes handset manufacturers/mobile phone providers add e.g. a WMA codec to the platform.
Did they also take care of any license fees or is a developer of a audio / video recorder / player or soundtrack enriched game using any of those codecs still required to take care of licensing themselves?
Thanks.
- Benny
I actually need this functionality so I can preserve the keyboard state when the user is navigating between activities or there is an orientation change, etc. We had to hide the keyboard in the onPause() method due to a bug where if the soft key is open, then you open a new activity that doesn't need the use of the soft key (no fields are present) it opens the new activity as if it was sized with a soft key open. There is an ugly black space in this case.Granted if that was fixed I wouldn't even need this functionality however getSoftKeyState() should exist regardless of this bug frankly.
On Saturday, July 14, 2012 7:44:24 PM UTC-6, Kalin Maldjanski wrote:It is a bit old reply but Dear Dianne, in your answers i mostly see Why do you want to this or that this way or the other way. This is not actually a response.
The fact is that:
1) When IME is active the application can behave differently, especially on KeyEvent.KEYCODE_DPAD_UP/DOWN. And as somebody said this is really important in testing and not only 'unit' testing as you suggested.
2) There is no real straight forward way/method to find out if IME is active or not. you have to monitor various events to be able to find this out.
hello dear, you have to make InputMethodManager object and if InputMethodManager isAcceptingText then means keybord is open else not open.this snipped has tested more then 2 times....
InputMethodManager imm = (InputMethodManager) getActivity()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isAcceptingText()) {
Log.d(TAG,"Software Keyboard was shown");
} else {
Log.d(TAG,
"Software Keyboard was not shown");