解决方案 »

  1.   

    editText.setInputType(EditorInfo.TYPE_CLASS_PHONE);http://blog.csdn.net/chaihuasong/article/details/7468739
      

  2.   

    楼上正解,也可以在布局文件里设置inputType
      

  3.   

    就是他了,直接xml中加入到EditText即可
      

  4.   

    感谢各位大神支持,看了各位回复,我研究了一下,并总结
    1、布局xml文件加入inputType ="number",或者如1#回复者的URL例子xml加入android:digits="1234567890."
    2、java源码加入editText.setInputType(EditorInfo.TYPE_CLASS_PHONE);二者缺一不可,1#回复者正解