2017-11-09 4 views
1

カスタムキーボードはソフトキーボードリストに表示されません。入力方法ダイアログにはどのように表示されますか? 他のOSでは正常に動作していますが、Android Nougatでは表示されません。Android 7.0でソフトキーボードを選択

私は以下のソースコードを使用しています。

private void showInputMethodPicker() { 
     InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); 
     if (imeManager != null) { 
      imeManager.showInputMethodPicker(); 
     } else { 
     Toast.makeText(this, "Error in keyboard", Toast.LENGTH_LONG).show(); 
    } 
} 

答えて

0
boolean isListedInKeyboardMethod() { 

     boolean flag = false; 
     InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); 
     List<InputMethodInfo> InputMethods = imeManager.getEnabledInputMethodList(); 
     for (InputMethodInfo info : InputMethods) { 
      if(info.getId().equalsIgnoreCase(keyboard_name)) 
       return true; 
     } 

     return flag; 

    } 



private void showInputMethodPicker() { 
    InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); 
    if (imeManager != null) { 
     imeManager.showInputMethodPicker(); 
    } else { 
     Toast.makeText(this, "Error in keyboard", Toast.LENGTH_LONG).show(); 
    } 
} 
関連する問題