Android Question After running about 3 hours black screen occurs

Baris Karadeniz

Active Member
Licensed User
When my app runs at the background, about 3 hours later, if I want to open it black screen comes into the front of the screen. What can be the problem?
 

Baris Karadeniz

Active Member
Licensed User
Here are the codes. There are several panels in the layout. But only Main is visible at the activity layout.

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
   
    Activity.LoadLayout("Main")
    p.SetScreenOrientation(1)
   
    locale.Initialize
    Timer1.Initialize("Timer1", 5000)
    PanelMain.Visible = True
    PanelLanguage.Visible = False
    PanelStatus.Visible = False
    PanelMap.Visible = False
    PanelCamera.Visible = False
    PanelDrvUserManual.Visible = False
    PanelMessage.Visible = False
   
    BtnSystemOnOff.TextOn = "System On/Off"
    BtnSystemOnOff.TextOff = "System On/Off"
    BtnOccUnocc.TextOn = "Occupied/Unoccupied"
    BtnOccUnocc.TextOff = "Occupied/Unoccupied"
    BtnMap.Text = "Map"
    BtnStatus.Text = "Status"
    BtnMessage.Text = "Message"
    BtnCamera.Text = "Camera"
    BtnDrvUserManual.Text = "User manual"
    BtnSOS.Text = "SOS"
    BtnLanguage.Text = "Language"
   
    lblGPSname.Text = "Location Service"
    lblLatitudeName.Text = "Latitude"
    lblLongitudeName.Text = "Longitude"
    lblAltitudeName.Text = "Altitude"
    lblHeadingName.Text = "Heading"
    lblSpeedName.Text = "Speed"
    lblAccuracyName.Text = "Accuracy"
    lblTimeName.Text = "Time"
    lblimeiName.Text = "IMEI"
    AlertMessage = "You have a new message."
    warningtitle1 = "ATTENTION"
    warning1 = "Please press on the User manual button to adjust settings."
    warning2 = "Please enter 15 digits IMEI number."
    PhotoSend = "Photo is uploaded."
    lblgpstextenable = "Enabled"
    lblgpstextdisable = "Please enable location services"
    TextFieldimei.Hint = "Please write your IMEI number here."
    lblSatellites.Text = "Satellites"
    btnFocus.Text = "Take photo"
   
    GetPreferredLanguage
   
    If File.Exists(File.DirInternal,"user") Then
            TextFieldimei.Text = File.ReadMap(File.DirInternal,"user").Get("userimei")
            imeiService = TextFieldimei.Text
        Else
            TextFieldimei.Text = ""
            imeiService = TextFieldimei.Text
    End If
   
    Event = ""
    occupied = "chat=1|cost=0|occupied=0|batp=100|bats=1|"
   
    EventService = Event
    occupiedService = occupied
   
    DateTime.DateFormat= "yyyy-MM-dd HH:mm:ss"
   
    BtnSystemOnOff.Color = Colors.Red
    BtnOccUnocc.Color = Colors.Red
   
    Dim WebViewSettingsMap As WebViewSettings
    WebViewSettingsMap.setDefaultZoom(WebViewMap, "FAR")
    WebViewSettingsMap.setLoadWithOverviewMode(WebViewMap, True)
    WebViewSettingsMap.setUseWideViewPort(WebViewMap, True)
    WebViewSettingsMap.setDisplayZoomControls(WebViewMap, False)
    webviewextrasMap.addWebChromeClient(WebViewMap,"webviewextrasMap")
   
    Dim WebViewSettingsDrvUserManual As WebViewSettings
    WebViewSettingsDrvUserManual.setDefaultZoom(WebViewDrvUserManual, "FAR")
    WebViewSettingsDrvUserManual.setLoadWithOverviewMode(WebViewDrvUserManual, True)
    WebViewSettingsDrvUserManual.setUseWideViewPort(WebViewDrvUserManual, True)
    WebViewSettingsDrvUserManual.setDisplayZoomControls(WebViewDrvUserManual, False)
   
    Dim WebViewSettingsMessage As WebViewSettings
    WebViewSettingsMessage.setDefaultZoom(WebViewMessage, "FAR")
    WebViewSettingsMessage.setLoadWithOverviewMode(WebViewMessage, True)
    WebViewSettingsMessage.setUseWideViewPort(WebViewMessage, True)
    WebViewSettingsMessage.setDisplayZoomControls(WebViewMessage, False)
   
    ime1.Initialize("ime1")
    ime1.AddHeightChangedEvent
    Dim jo As JavaObject = Activity
    jo.RunMethodJO("getContext", Null).RunMethodJO("getWindow", Null).RunMethod("setSoftInputMode", _
    Array As Object(0x20))
    ActivityParent = jo.RunMethodJO("getParent", Null)
   
    ime2.Initialize("ime2")
   
    BtnSystemOnOff.Checked = False
    BtnOccUnocc.Checked = False
    systemon = False
   
    Timer1.Enabled=True
   
End Sub
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
There is no problem at the first load. I think there is a problem at the Resume. Because it happens about 3 hours later. And there is nothing at the resume.

B4X:
Sub Activity_Resume
    AfterChange
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Baris Karadeniz

Active Member
Licensed User
I ran my app debug mode and release mode. It is already uploaded to the Google Play and downloadable. App name is TAKSİ'M Driver. I downloaded from Google play and ran. Can you please try also?
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
Screenshot is given attached.
 

Attachments

  • 2016-06-13-17-01-05.png
    2016-06-13-17-01-05.png
    198.4 KB · Views: 335
Upvote 0

Baris Karadeniz

Active Member
Licensed User
It says java.lang.NumberFormatException. Information is at given attached pictures. What do you advice? It says that device is hct6735m_35gu_l1. But your device is Oukitel.
 

Attachments

  • AndroidCrash1.png
    AndroidCrash1.png
    67.1 KB · Views: 359
  • AndroidCrash2.png
    AndroidCrash2.png
    112.6 KB · Views: 330
Upvote 0

Baris Karadeniz

Active Member
Licensed User
So, it is not related with app if it is related with your internet access? And what happened when it is crashed? App is closed? If app is closed did you try to open again?
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
If are at the camera screen and pause the app and resume again black screen comes but if you press on the back and come again to camera it is ok. It is related with camera I know but I couldn't solve.

But You said that it happened after you took a picture. It is interesting. I will look to the developers console and inform you.
 
Upvote 0
Top