Android Question Crash while loading?


Active Member
I got a problem while loading a pixmap using a user requester. I save it inside local memory for later conversion into pixmap, and the code works in isolation but not with inside my game that uses.. the admob, starter and b4pages setup? One of these things must be trigger this and it only appens on one of my devices (a mid range, the code works on both 4.4.4 an on 9.0 for instance but not on 7.0). Any ideas what it could be becuase this is my carefully constructed base and I can't throw it away.

' The ERRORMSG you would get on an Samsung A3 with 7.0
' Other devices from 4.4.4 to 9.0 works fine.

' All devices works fine when not using with Starter, BX4MainPage or Adshelper or somethint else disturbing? That's whay it seem to be doing but I have no idea how to go from here to debug as I need all of these in my project and cannot delete.

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
success load
main_loadchooser_result (java line: 376) No such file or directory
    at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(
    at android.content.ContentProviderProxy.openTypedAssetFile(
    at android.content.ContentResolver.openTypedAssetFileDescriptor(
    at android.content.ContentResolver.openAssetFileDescriptor(
    at android.content.ContentResolver.openInputStream(
    at anywheresoftware.b4a.objects.streams.File.OpenInput(
    at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(
    at anywheresoftware.b4a.keywords.Common.LoadBitmap(
    at b4a.example.main._loadchooser_result(
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(
    at anywheresoftware.b4a.BA.raiseEvent(
    at anywheresoftware.b4a.BA$
    at anywheresoftware.b4a.BA.setActivityPaused(
    at b4a.example.main$
    at android.os.Handler.handleCallback(
    at android.os.Handler.dispatchMessage(
    at android.os.Looper.loop(
    at java.lang.reflect.Method.invoke(Native Method)
#End If

' DEMO :  Load pixmap from using filerequester
#Region Init
    #MultiDex: True
    #Region Project Attributes
        #FullScreen: True
        #IncludeTitle: False
        #ApplicationLabel: Demo
        #VersionCode: 1
        #SupportedOrientations: Portrait
          #CanInstallToExternalStorage: False   
    #End Region
#End Region

#Region  Project Attributes
    #ApplicationLabel: Load
    #VersionCode: 1
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

Sub Process_Globals
    Dim loadChooser As ContentChooser
End Sub

Sub Globals
End Sub

Sub Activity_Create(FirstTime As Boolean)
    loadChooser.Show("image/*", "Choose image") ' Chooser.Show("audio/*", "Choose audio file")
End Sub
Sub loadChooser_Result (Success As Boolean, Dir As String, FileName As String)
    If Success = True Then
        Log("success load")
        If File.Exists(Dir, FileName) Then Log("EXISTS")
        Dim image As Bitmap
        image = LoadBitmap(Dir, FileName)

        If File.Exists(File.DirInternal, "a.png") Then Log("EXISTS")

        'If File.Exists(File.DirInternal, "temp.png") Then
        '    File.Delete(File.DirInternal, "temp.png")
        'End If

        ToastMessageShow("ERROR LOADING!", True)
    End If
End Sub

Sub SaveBitmapAsPNG(bitmap As Bitmap, fileName As String) As Boolean
        Dim out As OutputStream = File.OpenOutput(File.DirInternal, fileName, False)
        bitmap.WriteToStream(out, 100, "PNG")
        Return True
        Return False
    End Try
End Sub


    12.7 KB · Views: 64