I am using MonoDevelop for Android and i am trying to create a Drawable variable from an image in the resources folder.
I have the following files in my Resources\drawable folder:
Drawable icon = Drawable.CreateFromPath("Icon.png");
Drawable icon = R.getResources().getDrawable(R.drawable.Icon);
Drawable icon = R.getResources().getDrawable(R.drawable.monkey);
You're very close, but I think you're mixing Java and C#.
You can access this using the
Resource structure. I've put both the Mono for Android and Java versions below for reference but in your case you want the C# version if you're using Mono for Android.
Mono for Android (C#)
Drawable icon = Resources.GetDrawable(Resource.Drawable.Icon);
Android SDK (Java)
Resources res = getResources(); Drawable icon = res.getDrawable(R.drawable.Icon);