Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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);
        }
    }
}