Back to project page OHC-android.
The source code is released under:
MIT License
If you think the Android project OHC-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package io.openhc.ohc.ui.input.filter; /*w w w . j av a 2 s. c om*/ import android.text.InputFilter; import android.text.Spanned; import io.openhc.ohc.basestation.device.Field; public class Input_filter_float implements InputFilter { private Field field; public Input_filter_float(Field field) { this.field = field; } @Override public CharSequence filter(CharSequence input, int start, int end, Spanned dest, int dstart, int dend) { try { int i = Integer.parseInt(input.toString()); if(i >= this.field.get_min() && i <= this.field.get_max()) return null; } catch(NumberFormatException ex) { } return ""; } }