Here you can find the source of toPixel(String value)
public static String toPixel(String value)
//package com.java2s; //License from project: Open Source License public class Main { public static String toPixel(String value) { String ret = value;//from w w w.j a v a 2 s. c o m if (value.startsWith("@")) { } else { if (value.contains("px")) { ret = value.replace("px", ""); } else if (value.contains("dp")) { ret = value.replace("dp", ""); } else if (value.contains("dip")) { ret = value.replace("dip", ""); } else if (value.contains("sp")) { ret = value.replace("sp", ""); } } return ret; } }