AndroidResource 9patch problem

ferya

Member
Licensed User
Longtime User
I try to use android drawable resource.
the code bellow works with all resources except 9patch drawables
how could solve this problem?

Dim BitmapDrawable1 As BitmapDrawable
Dim DrawableName As String
Dim Object1 As Object
DrawableName="gallery_selected_default"
Object1=AndroidResources1.GetAndroidDrawable(DrawableName)
If Object1=Null Then
Log("Drawable NOT FOUND: "&DrawableName)
ImageView1.Bitmap=Null
Else
BitmapDrawable1=Object1
ImageView1.Bitmap=BitmapDrawable1.Bitmap
End If

the error code is
java.lang.ClassCastException: android.graphics.drawable.NinePatchDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
 

ferya

Member
Licensed User
Longtime User
thank you for reply

Sorry,
I changed cod but got same error.
I cant find the place of (questions forum)
 
Top