Android Question using system resources

Smee

Well-Known Member
Licensed User
Longtime User
How do i put or remove an icon into\from the Android system resources folder? Is this possible? If not i want to be able to just add a small icon to an iview.
 

Smee

Well-Known Member
Licensed User
Longtime User
this is the existing code and i want to adapt it by changing the icon. I will look at your link. Thanks

iv.Background = LoadDrawable("ic_menu_more")
 
Upvote 0

Smee

Well-Known Member
Licensed User
Longtime User
I tried adding the folder and the files to the folder. They disappeared after running the program. I got an error also when i ran the program "
"....Resources$NotfoundException..."

I should note that this is the sub I am using
B4X:
Sub LoadDrawable(Name As String) As Object
    'Gets a drawable from the Android system resources
    Dim r As Reflector
    r.Target = r.GetContext
    r.Target = r.RunMethod("getResources")
    r.Target = r.RunMethod("getSystem")
    Dim ID_Drawable As Int
    ID_Drawable = r.RunMethod4("getIdentifier", Array As Object(Name, "drawable", "android"), _
                                               Array As String("java.lang.String", "java.lang.String", "java.lang.String"))
    r.Target = r.GetContext
    r.Target = r.RunMethod("getResources")
    Return r.RunMethod2("getDrawable", ID_Drawable, "java.lang.int")
End Sub
 
Upvote 0
Top