MainActivity.java 698 B

12345678910111213141516171819202122232425262728293031
  1. //% IMPORTS
  2. import android.view.inputmethod.InputMethodManager;
  3. import autosuggest.CustomInputConnection;
  4. //% END
  5. //% MAIN_ACTIVITY_BODY
  6. public void cancelComposition() {
  7. InputMethodManager imm =
  8. (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
  9. imm.restartInput(view);
  10. }
  11. //% END
  12. //% QUAD_SURFACE_ON_CREATE_INPUT_CONNECTION
  13. // Needed to fix error: unreachable statement in Java
  14. if (true) {
  15. outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT
  16. | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
  17. outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN
  18. | EditorInfo.IME_ACTION_NONE;
  19. return new CustomInputConnection(this, outAttrs);
  20. }
  21. //% END