public static String convertToRGB(int color){
  String red=Integer.toHexString(Color.red(color));
  String green=Integer.toHexString(Color.green(color));
  String blue=Integer.toHexString(Color.blue(color));
  if (red.length() == 1) {
    red="0" + red;
  }
  if (green.length() == 1) {
    green="0" + green;
  }
  if (blue.length() == 1) {
    blue="0" + blue;
  }
  return "#" + red + green+ blue;
}

public static String convertToRGB ( int color ) { String red = Integer . toHexString ( Color . red ( color ) ) ; String green = Integer . toHexString ( Color . green ( color ) ) ; String blue = Integer . toHexString ( Color . blue ( color ) ) ; if ( red . length ( ) == 1 ) { red = "0" + red ; } if ( green . length ( ) == 1 ) { green = "0" + green ; } if ( blue . length ( ) == 1 ) { blue = "0" + blue ; } return "#" + red + green + blue ; }
method currently used by ongetdefaultvalue method to convert hex string provided in android : defaultvalue to color integer .
