Hi all! In my app, an user says that application crash, and sent me the log of the error. He has a Huawey y6. I tried with 4 devices, but without any issue. Can anyone helps me? Thanks
This is the code
B4X:
--------- beginning of system
--------- beginning of main
~i:*** Service (starter) Create ***
Device locale: it
Found 759 strings.
loc it
Found 759 strings.
loc it
~i:** Service (starter) Start **
~i:** Activity (main) Create, isFirst = true **
~i:** Activity (main) Resume **
~i:** Activity (main) Pause, UserClosed = false **
~i:** Activity (popup) Create, isFirst = true **
~i:** Activity (popup) Resume **
~i:** Activity (popup) Pause, UserClosed = true **
~i:** Activity (main) Resume **
~i:** Activity (main) Pause, UserClosed = false **
~i:** Activity (boss) Create, isFirst = true **
~e:boss_activity_create (java line: 440)
~e:java.lang.RuntimeException: Error loading bitmap.
~e: at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:538)
~e: at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:516)
~e: at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1315)
~e: at ed.tactivision.com.boss._activity_create(boss.java:440)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at java.lang.reflect.Method.invoke(Method.java:372)
~e: at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
~e: at ed.tactivision.com.boss.afterFirstLayout(boss.java:102)
~e: at ed.tactivision.com.boss.access$000(boss.java:17)
~e: at ed.tactivision.com.boss$WaitForLayout.run(boss.java:80)
~e: at android.os.Handler.handleCallback(Handler.java:739)
~e: at android.os.Handler.dispatchMessage(Handler.java:95)
~e: at android.os.Looper.loop(Looper.java:135)
~e: at android.app.ActivityThread.main(ActivityThread.java:5593)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at java.lang.reflect.Method.invoke(Method.java:372)
~e: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
~e: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
java.lang.RuntimeException: Error loading bitmap.
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:538)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:516)
at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1315)
at ed.tactivision.com.boss._activity_create(boss.java:440)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at ed.tactivision.com.boss.afterFirstLayout(boss.java:102)
at ed.tactivision.com.boss.access$000(boss.java:17)
at ed.tactivision.com.boss$WaitForLayout.run(boss.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5593)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
This is the code
B4X:
Dim st() As String = Array As String(Utils.Tr("ut_124"),Utils.Tr("ut_125"), Utils.Tr("ut_122"))
Dim img() As String = Array As String("map.jpg","mapdz.png","map2.png")
For i = 0 To st.Length-1
'other stuff
Dim imv As JSTouchImageView
imv.Initialize
p.AddView(imv,0,0,VP.Width,VP.Height)
imv.ScaleType = imv.SCALE_TYPE_FIT_CENTER
imv.Tag = i
If File.Exists(File.DirInternal,img(i)) Then
imv.ImageBitmap = LoadBitmap(File.DirInternal,img(i))
pb.RemoveView
Else
DownloadImage(i, pb, img(i))
End If
'other stuff
next
'...
end sub
Sub DownloadImage (ind As Int, pb As ProgressBar, name As String)
Dim Job As HttpJob
Job.Initialize(name,Me)
Job.Tag = Array(ind,pb)
Job.Download("mysite"&name)
End Sub
Sub JobDone (job As HttpJob)
If job.Success Then
Dim ar() As Object = job.Tag
Dim ind As Int = ar(0)
Dim pb As ProgressBar = ar(1)
pb.RemoveView
Dim out As OutputStream = File.OpenOutput(File.DirInternal,job.JobName,False)
File.Copy2(job.GetInputStream, out)
out.Close '<------ very important
RefreshZoomImage(ind,job.GetBitmap)
End If
End Sub
Sub RefreshZoomImage (ind As Int,bitm As Bitmap)
Dim p As Panel = PC.GetPageObject(ind)
Dim imv As JSTouchImageView
imv.Initialize
p.AddView(imv,0,0,VP.Width,VP.Height)
imv.ScaleType = imv.SCALE_TYPE_FIT_CENTER
imv.ImageBitmap = bitm
End Sub