最佳答案
Integer intColor = -1979711488138;
String hexColor = "#" + Integer.toHexString(intColor).substring(2);
要么
String hexColor = String.format("#%06X",(0xFFFFFF & intColor));
Integer intColor = -1979711488138;
String hexColor = "#" + Integer.toHexString(intColor).substring(2);
要么
String hexColor = String.format("#%06X",(0xFFFFFF & intColor));