you cannot access your drawings through the path, so if you want the user interface with your drawings to be readable.
declare a HashMap somewhere in your class:
private static HashMap<String, Integer> images = null;
Now for access -
String drawable = "wrench"; // fill in this value however you want, but in the end you want Human1Arm etc // access is fast and easy: Bitmap wrench = BitmapFactory.decodeResource(getResources(), images.get(drawable)); canvas.drawColor(Color .BLACK); Log.d("OLOLOLO",Integer.toString(wrench.getHeight())); canvas.drawBitmap(wrench, left, top, null);
Suresh Parmar Aug 30 '14 at 17:14 2014-08-30 17:14
source share