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

Discussion in 'Android Questions' started by Mahares, Aug 25, 2015.

  1. Mahares

    Mahares Well Known Member Licensed 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:
    http://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/#post-182494
    Thank you
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    This fix is already implemented in the core library. Can you post your Activity_KeyPress code?
     
  3. Mahares

    Mahares Well Known Member Licensed User

    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.
    Code:
    Sub Activity_KeyPress (KeyCode As Int) As Boolean  
      
    If KeyCode = KeyCodes.KEYCODE_BACK Then
        Cursor1.Close
        SQL1.Close
        
    Activity.Finish 
      
    End if
    End Sub
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I don't think that it is related to that issue.
    Note that you don't need this code as all.

    Handle Activity_Pause and close SQL1 if UserClosed is true (don't call Activity.Finish).
     
  5. Mahares

    Mahares Well Known Member Licensed User

    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.

    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:
    Code:
    Sub Activity_Pause (UserClosed As Boolean)
       
    If UserClosed Then SQL1.Close
    End Sub
    Thank you very much

     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice