EditText 初始顯示 "0",用戶輸入 "1" 變為 "01",需手動刪除默認值。
<EditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:hint="0" />
getText().toString() 為空串時視為未輸入,邏輯更清晰。android:inputType="number" // 僅數字
android:inputType="numberDecimal" // 允許小數點
android:digits="0123456789" // 自定義允許字符集