よく忘れるのでメモ InputType で入力を数字に制限するには 数字だけ入力可能 editText.setInputType(InputType.TYPE_CLASS_NUMBER); 小数点あり(1カ所だけ . を入力できる) editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); マイナスあり(先頭にだけ - を入力できる) editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED); 小数点あり、マイナスあり editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUM