Java Question Accessing "icon" in library?

barx

Well-Known Member
Licensed User
Longtime User
Howdy do

How would one return the Bitmap of the Icon file (or another file in the res/drawable folder)?

And what is this:

B4X:
BA.applicationContext.getResources().getIdentifier(s, "drawable", BA.packageName)

returning.

thanks
 

barx

Well-Known Member
Licensed User
Longtime User
It appears to return an int value?

I create a variable to store icon file for later use

B4X:
private static String nIcon;

Then later try to set it with

B4X:
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
 

barx

Well-Known Member
Licensed User
Longtime User
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
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
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

never mind for now, i may be creating problems that don't exist lol.
 
Top