Android examples for App:Resource
get Layout Id By Name from resource
//package com.java2s; import android.content.Context; import android.util.Log; public class Main { public static int getLayoutIdByName(Context context, String name, String packageName) { Log.d("cqm", "package name is " + packageName); return context.getResources().getIdentifier(name, "layout", packageName);//ww w .ja v a2 s . c o m } }