我有以下EditText,它是字符需要隱藏,因爲它是一個密碼。我可以用下面的方法做到這一點。如何將EditText設置爲密碼和數字鍵盤
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Please Enter Password/Pin"
android:inputType="textPassword"
>
我想鍵盤設置數值爲所有的密碼都是數字,但是當我這樣做是顯示的數字下面。我怎樣才能實現這兩個目標?
passwordPin = (EditText)findViewById(R.id.password);
passwordPin.setInputType(InputType.TYPE_CLASS_NUMBER);
android:password is deprecated:Use inputType instead –