本文介绍了当我点击"完成"在softkeybord如何去下一个活动的Andr​​oid按键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击softkeyboard我的键盘getdown或隐藏,但我想去下一个活动,当我在完成按钮,点击键盘的android.so上怎么办呢?

when i click on softkeyboard my keyboard getdown or hide but i want to go to next activity when i click on "done " button on keyboard of android.so how to do it?

和我的下一个QUS是,如果我有我的布局2编辑框,当我第一次编辑框中单击,然后在我的软键盘下一步会出现去下一个文本框,当我去到第二个文本框它的变化为完成。
   在此先感谢....

and my next qus is if i have 2 edit box in my layout when i click on first edit box then in my soft keyboard "next " would appear for going to next text box and when i go to second text box it change to "done". thanks in advance....

X

推荐答案

它是最好添加在布局一些按钮,所有Android手机不使用时imeoptions提供了一个一致的行为。

Its is better to add some button in the layout as all android phones dont provide a consistent behaviour when using imeoptions.

这似乎是一个错误。不同制造商生产定制的键盘为他们的手机,它可能无法完全表现为Android标准键盘。这个问题已经提出过。大多数人要么通过在overiding活动安其或使用TextWatcher类解决这个问题。的bug已经提交这个

This seems to be a bug. Different manufacturers make a customized keyboard for their phone which may not completely behave as the android standard keyboard. This issue has been raised before. Most people overcome this issue by either overiding the onKey event or using a TextWatcher class. A bug has been filed about this

您可以使用侦听器来检查imeoptions

You can use a listener to check for imeoptions

incomeInput.setOnEditorActionListener(new EditText.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE){
                    //Do your stuff here
                    return true;  // mark the event as consumed
                }
            return false;
            }
}

这篇关于当我点击"完成"在softkeybord如何去下一个活动的Andr​​oid按键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 06:06