Convert int To Hex Str - Android java.lang

Android examples for java.lang:Hex

Description

Convert int To Hex Str

Demo Code

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Main{

    @NonNull//from   w w w.j a  v a2  s  .c o m
    public static String intToHexStr(int i) {
        return String.format("x%08x", i);
    }

}

Related Tutorials