在我的Android應用程序中有一個應該保留數值的EditText;這就是爲什麼我把它定義爲如何在Android中清除數字editText?
<EditText android:layout_width="fill_parent" android:id="@+id/TextNumb"
android:layout_height="wrap_content" android:gravity="right|center" android:maxLines="1"
android:maxLength="10" android:inputType="number|numberSigned|numberDecimal"/>
但在我的應用程序的某一點上,我想清楚了,所以在我的活動我稱之爲的EditText查看和我寫的:
mEditView.setText("");
,但我得到運行時錯誤......我該如何解決它?有沒有辦法清潔它?
工作,但setText(「」)也應該工作,所以可能還有其他事情正在進行。 – adamcodes