Skip to content

Instantly share code, notes, and snippets.

View chenshengfa0803's full-sized avatar

shfa.chan chenshengfa0803

  • Guangzhou China
View GitHub Profile
public static InputMethodManager getInstance() {
synchronized (InputMethodManager.class) {
if (sInstance == null) {
IBinder b = ServiceManager.getService(Context.INPUT_METHOD_SERVICE);
IInputMethodManager service = IInputMethodManager.Stub.asInterface(b);
sInstance = new InputMethodManager(service, Looper.getMainLooper());
}
return sInstance;
}
}