Hi all,

I wrote a service which creates a "top bar", displayed on top of all 
activities, containing an EditText.
I want to display the soft-keyboard when that EditText is clicked, but this 
is not happening. Of course I've also tried this:

InputMethodManager imm = 
(InputMethodManager)this.getSystemService(Service.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);

both in onFocusChange() and onClick().

The workaround I came up with is to request the current activity to show the 
keyboard, by extending the Activity class and adding an AIDL interface. The 
drawback is that key events are captured my the activity and have to be sent 
back to the Service (via another AIDL inteface) and manually converted into 
Unicode.

Moreover, if the activity contains an EditText, the soft-keyboard only works 
for the activity and doesn't show up anymore when the service's EditText is 
selected.

Short question: Is it possible (and how) to display the soft-keyboard from a 
Service?

Long question: Short question + What prevents the service's soft-keyboard to 
be displayed if the current activity has an EditText? Could it be an Android 
limitation?

Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to