Back to project page SampleAndroidL.
The source code is released under:
GNU General Public License
If you think the Android project SampleAndroidL listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.fingerlinks.mobile.android.samplel; /* w w w . j av a 2 s . co m*/ import android.content.Context; /** * Created by Fabio Ranieri on 20/10/14. * Copyright 2014 Fingerlinks s.r.l. */ public class CodeUtils { /** * @param context * @param name * @return */ public static int getImageResourceId(Context context, String name) { try { return context.getResources(). getIdentifier(name, "drawable", context.getPackageName()); } catch (Exception e) { e.printStackTrace(); return -1; } } }