Hello guys, I have problime in my app but before I used it many times without any problimes ,,
I do not know what happened.
I used "Debug" and "Release"
Debug > stop working
Release > give me messame "unfortunately [app. Name] has stopped"
this my code
I do not know what happened.
I used "Debug" and "Release"
Debug > stop working
Release > give me messame "unfortunately [app. Name] has stopped"
this my code
B4X:
Sub chooser_Result(Success As Boolean, Dir As String, FileName As String)
If Success Then
Dim OutputStream1 As OutputStream
OutputStream1.InitializeToBytesArray(1000)
'''''''''''''''''''''''''''''
Dim b As Bitmap
b = LoadBitmap(Dir,FileName)
b = CreateScaledBitmap(b, 200, 200, True)
b.WriteToStream(OutputStream1, 1000, "PNG")
'''''''''''''''''''''''''''''
buffer = OutputStream1.ToBytesArray
OutputStream1.Close
ImageView1.Bitmap=LoadBitmap(Dir,FileName)
Else
ToastMessageShow("No image selected", True)
End If
End Sub
Sub CreateScaledBitmap(Original As Bitmap, Width As Int, Height As Int, Filter As Boolean) As Bitmap
Dim jo As JavaObject
jo.InitializeStatic("android.graphics.Bitmap")
Return jo.RunMethod("createScaledBitmap", Array (Original, Width, Height, Filter))
End Sub
Sub btnaddimgfromphone_Click
If Chooser.IsInitialized = False Then
Chooser.Initialize("chooser")
End If
Chooser.Show("image/*", "Choose image")
End Sub