Java tutorial
//package com.java2s; //License from project: Apache License import android.content.res.Resources; public class Main { public static String safeGetIdName(Resources resources, int id) { if (resources == null) { return String.valueOf(id); } try { return resources.getResourceEntryName(id); } catch (Resources.NotFoundException e) { return String.valueOf(id); } } }