Hi Everyone,
Can you tell me how to stop my app from crashing after an image is set as an activity background?
This is what happens.
The app sets the background image for the main activity:
The user clicks a button to call another activity:
That activity also sets the background image with the same coding.
From that activity the user clicks on the Stores button to load that activity and that activity also does the same thing with an image.
The app now crashes on this statement after the layout is loaded:
Is there some sort of setting I need to set?
The app also crashes if I start the app on the main activity and exit it with:
and run the app from the phone apps screen. If I comment out the setting of the background image on all activities, then no crash occurs.
Thanks.
Can you tell me how to stop my app from crashing after an image is set as an activity background?
This is what happens.
The app sets the background image for the main activity:
B4X:
Sub Activity_Create(FirstTime As Boolean)
' Open up the maintenance window.
'--------------------------------
Activity.LoadLayout("Maintenance")
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "grocerybig.jpg"))
End Sub
The user clicks a button to call another activity:
B4X:
Sub ButtonMaintenance_Click
StartActivity(Maintenance)
End Sub
That activity also sets the background image with the same coding.
From that activity the user clicks on the Stores button to load that activity and that activity also does the same thing with an image.
B4X:
Sub ButtonStores_Click
StartActivity(MaintenanceStores)
End Sub
The app now crashes on this statement after the layout is loaded:
B4X:
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "grocerybig.jpg"))
Is there some sort of setting I need to set?
The app also crashes if I start the app on the main activity and exit it with:
B4X:
Sub ButtonClose_Click
Activity.Finish
End Sub
and run the app from the phone apps screen. If I comment out the setting of the background image on all activities, then no crash occurs.
Thanks.