0

I got this exception on my application running on an Huawei P6 with Android 4.4.2

threadid=1: thread exiting with uncaught exception (group=0x41601c50)

No stacktrace given, every other device I tested (SG Ace 2, Nexus 7, Nexus 5, SGS3) runs the code fine.

This is the code getting executed when the application crashes:

@Override
protected void onResume(){
    super.onResume();

    if (System.currentTimeMillis()/1000 - Singleton.getInstance().getStoptime() > constants.DISPOSE_TIMEOUT) {
        Singleton.getInstance().destroyInstance();
        Intent intent = new Intent(getApplicationContext(), main_activity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
        return;
    }
}

EDIT: Full logcat of the whole phone after the crash can be found here: http://pastebin.com/uuuSwVAn

Cusy
  • 233
  • 1
  • 3
  • 11
  • main_activity is a class or xml? – M S Gadag Jan 15 '15 at 09:13
  • A class, the app is restarting if the screen has been locked for more than X seconds. – Cusy Jan 15 '15 at 09:18
  • I edited the question and added a full logcat of the phone after the crash. – Cusy Jan 15 '15 at 09:20
  • What is this Singleton class? – dragi Jan 15 '15 at 09:25
  • A singleton containing some information. It's instanced when I log into the application and it's not null at that time, the whole code inside the if get executed and then the app crashes. – Cusy Jan 15 '15 at 09:27
  • If I were you, I would use this method for restarting: http://stackoverflow.com/a/22377728/2160877 – dragi Jan 15 '15 at 09:31
  • It's not related to the crash, and I have nothing on the onDestroy so the new activity can be started before the previous one will be complete its lifecycle, plus the crash is happening only on this specific Huawei phone, every other phone I tested is restarting the application just fine. I'm wondering if it's more a EmotionUI-related problem (the Huawei custom framework). – Cusy Jan 15 '15 at 09:41
  • The method for restarting I proposed gives some time to the OS for the destroy - if you have empty onDestroy() it doesn't mean that your app will do nothing at that stage, it will execute the super implementation for it. But anyway, have you tried commenting part of onResume() just to see which line is causing the crash? – dragi Jan 15 '15 at 10:08
  • The whole onResume method gets executed (i used Log.w after every instruction and everything got printed). – Cusy Jan 15 '15 at 10:36

0 Answers0