Android examples for java.lang:Double
is a string a double Number
import android.location.Location; import java.math.BigDecimal; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.DecimalFormat; import java.text.NumberFormat; public class Main{ @SuppressWarnings("unused") public static boolean isNumber(String str) { try {// w w w. j a va 2s.co m double d = Double.parseDouble(str); } catch (NumberFormatException nfe) { return false;//str.matches("[0-9]{5}-?[0-9]{3}?"); } return true; } }