Closed PSDroid2022 closed 1 year ago
We confirm a compatibility issue which might threaten the robustness of your app and give a detailed suggestion for you.
In ''it.feio.android.omninotes.utils.KeyboardUtils", you invoke the API "<android.view.inputmethod.InputMethodManager: void toggleSoftInput(int,int)>" in "showKeyboard" method as shown in following. But actually, this API is deprecated in API level 31( https://developer.android.google.cn/reference/android/view/inputmethod/InputMethodManager?hl=en#toggleSoftInput(int,%20int)).
@Override public static void showKeyboard(View view) { if (view == null) { return; } view.requestFocus(); InputMethodManager inputManager = (InputMethodManager) view.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); inputManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); ((InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE)) .showSoftInput(view, 0); if (!isKeyboardShowed(view)) { inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); } }
So when the app try to invoke this API on devices after API level 31, your app will run with an unpredictable results. So we suggest you add an "if(SDK_INT < 31)" to fix this potential issue.
Hi there, thanks for the info. I'll currently tag this as wontfix for now because:
But I'll keep in mind the necessity to change this part when upgrading further.
We confirm a compatibility issue which might threaten the robustness of your app and give a detailed suggestion for you.
In ''it.feio.android.omninotes.utils.KeyboardUtils", you invoke the API "<android.view.inputmethod.InputMethodManager: void toggleSoftInput(int,int)>" in "showKeyboard" method as shown in following. But actually, this API is deprecated in API level 31( https://developer.android.google.cn/reference/android/view/inputmethod/InputMethodManager?hl=en#toggleSoftInput(int,%20int)).
So when the app try to invoke this API on devices after API level 31, your app will run with an unpredictable results. So we suggest you add an "if(SDK_INT < 31)" to fix this potential issue.
Android device