barx Well-Known Member Licensed User Longtime User Apr 8, 2012 #1 Howdy do How would one return the Bitmap of the Icon file (or another file in the res/drawable folder)? And what is this: Code: BA.applicationContext.getResources().getIdentifier(s, "drawable", BA.packageName) returning. thanks
Howdy do How would one return the Bitmap of the Icon file (or another file in the res/drawable folder)? And what is this: Code: BA.applicationContext.getResources().getIdentifier(s, "drawable", BA.packageName) returning. thanks
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2012 #2 This return a Drawable mapped to the value of s. Substitute s with "icon" to get the icon BitmapDrawable.
This return a Drawable mapped to the value of s. Substitute s with "icon" to get the icon BitmapDrawable.
barx Well-Known Member Licensed User Longtime User Apr 8, 2012 #3 It appears to return an int value? I create a variable to store icon file for later use Code: private static String nIcon; Then later try to set it with Code: nIcon = BA.applicationContext.getResources().getIdentifier("icon", "drawable", BA.packageName); In Eclipse I get a type mismatch error 'Cannot convert from int to String' Any clues? thanks
It appears to return an int value? I create a variable to store icon file for later use Code: private static String nIcon; Then later try to set it with Code: nIcon = BA.applicationContext.getResources().getIdentifier("icon", "drawable", BA.packageName); In Eclipse I get a type mismatch error 'Cannot convert from int to String' Any clues? thanks
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2012 #4 You are correct, you should then use ...getResources().getDrawable(nIcon),
barx Well-Known Member Licensed User Longtime User Apr 8, 2012 #5 Thank you. :sign0188: Never thought I would get into make a library but I'm loving it. Dreading the big test though lol.
Thank you. :sign0188: Never thought I would get into make a library but I'm loving it. Dreading the big test though lol.
barx Well-Known Member Licensed User Longtime User Apr 8, 2012 #6 Ha, I guess I now need to learn the difference between a Drawable and a Bitmap. And how to convert to Bitmap. The above obviously returns a drawable....... I need it to be a Bitmap..... Clues? lol
Ha, I guess I now need to learn the difference between a Drawable and a Bitmap. And how to convert to Bitmap. The above obviously returns a drawable....... I need it to be a Bitmap..... Clues? lol
barx Well-Known Member Licensed User Longtime User Apr 8, 2012 #7 barx said: Ha, I guess I now need to learn the difference between a Drawable and a Bitmap. And how to convert to Bitmap. The above obviously returns a drawable....... I need it to be a Bitmap..... Clues? lol Click to expand... never mind for now, i may be creating problems that don't exist lol.
barx said: Ha, I guess I now need to learn the difference between a Drawable and a Bitmap. And how to convert to Bitmap. The above obviously returns a drawable....... I need it to be a Bitmap..... Clues? lol Click to expand... never mind for now, i may be creating problems that don't exist lol.