0

我需要在我的活动中使用按钮而不是 android 键盘。我找到示例(http://developer.android.com/guide/topics/text/creating-input-method.html):

InputConnection ic = getCurrentInputConnection();

    ic.deleteSurroundingText(4, 0);

    ic.commitText("Hello", 1);

    ic.commitText("!", 1);

但我不明白如何在我的应用程序中使用它。我应该在哪里创建扩展 InputMethodService 的类,以及这个类必须有什么。请帮忙!!!

4

1 回答 1

0

您必须创建一个扩展 EditText 的类。然后您可以覆盖 onCreateInputConnection 方法。

于 2013-02-28T01:51:19.577 回答