convert int To Hex - Android java.lang

Android examples for java.lang:Hex

Description

convert int To Hex

Demo Code


//package com.java2s;

public class Main {
    public static String convertToHex(int colorInt) {
        //noinspection HardCodedStringLiteral
        return String.format("#%06X", (0xFFFFFF & colorInt));
    }//from  w  w  w  .  ja  v  a2 s.  c  o  m
}

Related Tutorials