Android Question Samsung Actice 6 Phone Reports Unfortunately 'App' has Stopped

Mahares

Expert
Licensed User
Longtime User
A user reported to me that the app on the Samsung Active 6 phone generated 'Unfortunately 'Application label name' has stopped error when exiting the app with the back key. The OS on the S6 is 5.0.2. I have the S5 with OS 5.0 and the app exits properly without seeing the problem that was seen on the S6. The app was compiled with B4A 4.3 in release.
Has anyone encountered this? Should I include the infamous fix by Erel reported a couple of years ago regadrding the back key and callsubdelayed in the following link:
https://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/#post-182494
Thank you
 

Mahares

Expert
Licensed User
Longtime User
Can you post your Activity_KeyPress code?
This is the same code I have for my Samsung S5 with OS 5.0 and it works without a hitch. But on the user's S6 with OS 5.0.2, the user claims he/she gets the error. I sent them the same apk I was using on the S5. They claim they installed the new apk and still have issues.
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean  
  If KeyCode = KeyCodes.KEYCODE_BACK Then
    Cursor1.Close
    SQL1.Close
    Activity.Finish 
  End if
End Sub
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I don't think that it is related to that issue.
You are absolutely correct. I finally received an S6 from the user and tested. The problem was with Scrollview2D 2.0 Lib. I changed it back to Scrollview 1.1 and the problem went away. I was getting this error:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference at flm.b4a.scrollview2d.EdgeEffect.draw(EdgeEffect.java:320)
I do not know why version 2.0 caused the problem. The programs worked just fine with version 2.0 on OS 5.0, but since the S6 had version OS 5.0.2, the application crashed. maybe Fred (Informatix) can address it.

Handle Activity_Pause and close SQL1 if UserClosed is true (don't call Activity.Finish).
I use Activity.finish because I am using several apps via a listview menu and intent to enter data, view data, graph data on a SQLite database and each menu option does one of the above functions by opening a separate app. If you still think activity.finish is still unnecessary, I can conduct a test by doing this:
B4X:
Sub Activity_Pause (UserClosed As Boolean)
   If UserClosed Then SQL1.Close
End Sub
Thank you very much

 
Upvote 0
Top