Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;

public class Main {
    /**
     * Get an identifier by string name
     * @param context The context
     * @param name The identifier name
     * @return The identifier
     */
    public static int getDrawableIdentifier(Context context, String name) {
        return context.getResources().getIdentifier(name, "drawable", context.getPackageName());
    }
}