1) Is INPUT_METHOD_CHANGED the correct intent to receive on to
determine if the user is attempting to use the keyboard, and if not,
what would be the proper method to use to monitor to see if the user
opens up the keyboard, and

==> onConfigurationChanged(Configuration conf)
could give you the event about user open the hard keyboard
ex. conf.hardKeyboardHidden

On 7月17日, 上午3時37分, Evan Cummings <emcummi...@gmail.com> wrote:
> Hello All,
>
> I am attempting to listen for system fired Intents, specifically
> regarding text input, using a class extending BroadcastReceiver. I see
> there is an Intent called ACTION_INPUT_METHOD_CHANGED
> (android.intent.action.INPUT_METHOD_CHANGED) which I hope to be able
> to use to know when the keyboard or text input is attempted by the
> user. (I assume this intent will work as I can use an
> InputMethodManager object to handle keyboard related tasks)
>
> My java code:
>
> package com.BroadcastReception;
>
> import android.content.BroadcastReceiver;
> import android.content.Context;
> import android.content.Intent;
> import android.util.Log;
>
> public class InputMethodChangedReceiver extends BroadcastReceiver {
>
>         @Override
>         public void onReceive(Context arg0, Intent arg1) {
>                 // TODO Auto-generated method stub
>                 if
> (arg1.getAction().equals("android.intent.action.INPUT_METHOD_CHANGED"))
> {
>                         Log.d(this.toString(), "Event Fired");
>                 }
>         }
>
> }
>
> My Manifest:
>
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>       package="com.BroadcastReception"
>       android:versionCode="1"
>       android:versionName="1.0">
>     <application android:icon="@drawable/icon" android:label="@string/
> app_name">
>                 <receiver android:name=".InputMethodChangedReceiver"
> android:enabled="true">
>                         <intent-filter>
>                                 <action
> android:name="android.intent.action.INPUT_METHOD_CHANGED"></
> action>
>                         </intent-filter>
>                 </receiver>
>
>     </application>
>
> <uses-permission android:name="android.permission.READ_INPUT_STATE"></
> uses-permission>
>
> </manifest>
>
> Using DDMS I never see my logs written, indicating to me that my
> broadcast receiver is not functioning properly.
>
> My question is this:
>
> 1) Is INPUT_METHOD_CHANGED the correct intent to receive on to
> determine if the user is attempting to use the keyboard, and if not,
> what would be the proper method to use to monitor to see if the user
> opens up the keyboard, and
>
> 2) Am I doing something incorrect in listening for the event,
> permissions, filters, etc? It would seem to me based on the resources
> I've looked at it that I'm along the right track, but I must be
> missing something!
>
> I appreciate the help and responses

-- 
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