Android Display Numeric Keypad on Button Click

感情迁移 提交于 2019-12-03 16:39:10

This one in your EditText property

android:inputType="phone" (This will displayed phone numeric keypad)

or

android:inputType="number" (This will displayed numeric keypad)

Now, you have to just set Focus on your EditText on Button's click..

something like,

edtNumber = (EditText) findViewById(R.id.number);

// Button's onClick....
@Override
 public void onClick(DialogInterface dialog, int which)
  {
    edtNumber.requestFocus();
  }

in EditText put below line.

android:inputType="number"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!