zoukankan      html  css  js  c++  java
  • android 获取文本框回车输入

    扫描头开启,并发送回车

    txtUsername.setOnEditorActionListener(new OnEditorActionListener() {

    @Override
    public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
    if(arg2.getKeyCode()==KeyEvent.KEYCODE_ENTER){
    // TODO Auto-generated method stub
    txtPassword.setText("xxxx");
    return true;
    }
    return false;
    }
    });

    <EditText
    android:id="@+id/txtUsername"
    android:imeOptions="actionDone"
    android:maxLines="1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" >

  • 相关阅读:
    JSON
    FBV & CBV
    django Tips
    Django2.2
    cookie & session
    ajax请求
    视图函数
    模板语法
    模板继承、组件
    python之路-----多线程与多进程
  • 原文地址:https://www.cnblogs.com/wdfrog/p/9672598.html
Copyright © 2011-2022 走看看