I must missing something obvious here but I can't see it
I have the simplest Activity to try to show an image and the image shows if the manifest has this entry
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="13"/>
If I set targetSdkVersion to 14 or higher the image doesn't show although the size of the bitmap is correctly logged so it looks like it has loaded it.
Also if I comment out ImageView1.Bitmap = Bitmap1 then ImageView1.Color = Colors.Red has no effect no matter what targetSdkVersion is set to.
I have the simplest Activity to try to show an image and the image shows if the manifest has this entry
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="13"/>
If I set targetSdkVersion to 14 or higher the image doesn't show although the size of the bitmap is correctly logged so it looks like it has loaded it.
Also if I comment out ImageView1.Bitmap = Bitmap1 then ImageView1.Color = Colors.Red has no effect no matter what targetSdkVersion is set to.
B4X:
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim Bitmap1 As Bitmap
End Sub
Sub Globals
Dim ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
ImageView1.Initialize("ImageView1")
Activity.AddView(ImageView1, 0, 0, 100%x, 100%y)
ImageView1.Color = Colors.Red
Log("Viewer created")
End Sub
Sub Activity_Resume
Bitmap1.Initialize(File.DirRootExternal, Starter.ViewerFolder & Starter.ViewerFilename)
ImageView1.Gravity = Gravity.FILL
ImageView1.Bitmap = Bitmap1
Log("Bitmap = " & Bitmap1.Width & " x " & Bitmap1.Height)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
' avoid hangs on rotation caused by large bitmaps
Log("Viewer Paused")
Dim Obj1 As Reflector
Obj1.Target = Bitmap1 ' the unwanted Bitmap
Obj1.RunMethod("recycle")
Bitmap1 = Null
End Sub