I've found several posts about getting the ID of a resource by name. I have tried two different methods, and never one works.
//This one returns 0:
int varInt = Resources.GetIdentifier ("background1", "drawable", PackageName);
//This one returns 'object reference not set':
int varInt = (int)typeof(Resource.Layout).GetField("background1").GetValue(null);
Am I doing something wrong? I have several drawable folders (i.e. drawable-land, drawable-port, etc.), but I tried using drawable-land in the above code and it still returns 0. Thanks!