Como conserta esse erro no java android InputMethodManager.peekInstance() is deprecated…
- User
Como conserta esse erro no java android InputMethodManager.peekInstance() is deprecated because it cannot be compatible with multi-display. Use context.getSystemService(InputMethodManager.class) instead. 12-19 08:38:15.947 20587 20587 W InputMethodManager: java.lang.Throwable
Assistant
The
InputMethodManager.peekInstance()method is deprecated in Android O and later versions, and it is recommended to usecontext.getSystemService(InputMethodManager.class)instead. This is becausepeekInstance()is not compatible with multi-display setups.Here's an example of how you can use
getSystemService()to get an instance of theInputMethodManager:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.