manager.setInputMethod(null, "com.anhuioss.simpleime/.service.SimpleKeyboard");
// manager.switchToLastInputMethod(null); 该方法可以会把输入法切回上一次所设置的输入法,也要在源码下才能编译通过。
}
/********************************************/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testchangeinput"
android:sharedUserId="android.uid.system"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<use-permission android:name="android.permission.WRITE_SETTING"/>
<use-permission android:name="android.permission.WRITE_SECURE_SETTING"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.testchangeinput.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>