@@ -203,10 +203,13 @@ protected void onCreate(Bundle savedInstanceState) {
203203
204204 // fix bug where the tabs are blank when the application is relaunched:
205205 super .onCreate (savedInstanceState ); // should fix most of the crashes in the ANR report on Play Store
206- if (!BuildConfig .DEBUG )
207- Fabric .with (this , new Crashlytics ());
208206 if (runningActivity == null || !isTaskRoot ()) {
209- Thread .setDefaultUncaughtExceptionHandler (unCaughtExceptionHandler );
207+ if (!BuildConfig .DEBUG ) {
208+ Log .w (TAG , "Loading crashlytics" );
209+ Fabric .with (this , new Crashlytics ());
210+ }
211+ Log .w (TAG , "Created new activity" );
212+ //Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler);
210213 }
211214 if (!isTaskRoot ()) {
212215 Log .w (TAG , "ReLaunch Intent Action: " + getIntent ().getAction ());
@@ -711,7 +714,10 @@ else if(ChameleonIO.WAITING_FOR_RESPONSE && ChameleonIO.isCommandResponse(liveLo
711714 String [] strLogData = (new String (liveLogData )).split ("[\n \r ]+" );
712715 //Log.i(TAG, strLogData);
713716 ChameleonIO .DEVICE_RESPONSE_CODE = strLogData [0 ];
714- ChameleonIO .DEVICE_RESPONSE = Arrays .copyOfRange (strLogData , 1 , strLogData .length );
717+ if (strLogData .length >= 2 )
718+ ChameleonIO .DEVICE_RESPONSE = Arrays .copyOfRange (strLogData , 1 , strLogData .length );
719+ else
720+ ChameleonIO .DEVICE_RESPONSE [0 ] = strLogData [0 ];
715721 if (ChameleonIO .EXPECTING_BINARY_DATA ) {
716722 int binaryBufSize = liveLogData .length - ChameleonIO .DEVICE_RESPONSE_CODE .length () - 2 ;
717723 ChameleonIO .DEVICE_RESPONSE_BINARY = new byte [binaryBufSize ];
0 commit comments