Android Question Back to the app crash

Discussion in 'Android Questions' started by rogersantosferreira, Sep 13, 2015.

  1. rogersantosferreira

    rogersantosferreira Member Licensed User


    I'm getting strange messages when I left and return to application using motorola devices like the G2 with Android 5.0.2. I have tested it on various other devices such as Samsung, LG, Positivo and even in earlier version of Motorola itself. Only G2 Motorola have these problems. Any help or suggestion?

    Details at files below...

    Attached Files:

  2. Roycefer

    Roycefer Well-Known Member Licensed User

    Naively, it looks like your app is trying to use a Cursor object that hasn't been initialized. This could be caused by any number of programming errors.

    You could have declared a Cursor in Activity_Globals instead of Process_Globals and only initialized it in Activity_Create when FirstTime==True. This way, whenever you come back into the app and it hasn't been cleared from memory, the Cursor will be created again but not initialized.

    Another possibility is that the Cursor object in question is a local variable in a sub that runs as a result of Activity_Resume being called but the SQLite query whose results are assigned to the Cursor during normal operation is only performed in Activity_Create when FirstTime==True.

    The Exception is being thrown from at least 2 different subs, so you know which subs to check, at least.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Use the Starter Service to load everything that your app needs.
  4. rogersantosferreira

    rogersantosferreira Member Licensed User

    Thanks Roicefer and Erel...
    I've been declared Cursors in methods that use it. To solve this problem, I change the declaration of cursors to globals in Process Globals and the initialization of global resources on the project were moved to a Starter Service.

    Now, it works fine.
    Thanks again to you guys!
  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