import android.provider.Settings;
import android.text.TextUtils;


获取默认输入法包名:
    private String getDefaultInputMethodPkgName(Context context) {
        String mDefaultInputMethodPkg = null;

        String mDefaultInputMethodCls = Settings.Secure.getString(
                context.getContentResolver(),
                Settings.Secure.DEFAULT_INPUT_METHOD);
        //输入法类名信息
        Log.d(TAG, "mDefaultInputMethodCls=" + mDefaultInputMethodCls);
        if (!TextUtils.isEmpty(mDefaultInputMethodCls)) {
            //输入法包名
            mDefaultInputMethodPkg = mDefaultInputMethodCls.split("/")[0];
            Log.d(TAG, "mDefaultInputMethodPkg=" + mDefaultInputMethodPkg);
        }
        return mDefaultInputMethodPkg;
    }
    
    
    

 

相关文章:

  • 2021-08-12
  • 2021-12-24
  • 2022-12-23
  • 2022-02-19
  • 2021-08-15
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2021-11-07
  • 2021-08-16
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-11-27
相关资源
相似解决方案