Java Code Examples for android.view.inputmethod.InputMethodInfo#getServiceName()

The following examples show how to use android.view.inputmethod.InputMethodInfo#getServiceName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomApplicationHelper.java    From AndroidTVWidget with Apache License 2.0 5 votes vote down vote up
public void setDefaultInputMethod(InputMethodInfo info) {
	// 设置默认输入法.
	String packName = info.getPackageName();
	String serviceName = info.getServiceName();
	int lastIndex = serviceName.lastIndexOf(".");
	if (lastIndex != -1) {
		String setInfo = packName + "/" + serviceName.substring(lastIndex);
		Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD,
				"" + setInfo);
	}
}
 
Example 2
Source File: CustomApplicationHelper.java    From Android-tv-widget with Apache License 2.0 5 votes vote down vote up
public void setDefaultInputMethod(InputMethodInfo info) {
	// 设置默认输入法.
	String packName = info.getPackageName();
	String serviceName = info.getServiceName();
	int lastIndex = serviceName.lastIndexOf(".");
	if (lastIndex != -1) {
		String setInfo = packName + "/" + serviceName.substring(lastIndex);
		Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD,
				"" + setInfo);
	}
}