Project

General

Profile

« Previous | Next » 

Revision 00ffccc4

Added by Leszek Koltunski over 4 years ago

Report to Firebase exceptions with dismissing the Main Dialog.

View differences:

src/main/java/org/distorted/states/RubikStateMain.java
28 28
import android.widget.LinearLayout;
29 29
import android.widget.TextView;
30 30

  
31
import com.google.firebase.crashlytics.FirebaseCrashlytics;
32

  
31 33
import org.distorted.dialogs.RubikDialogMain;
34
import org.distorted.main.BuildConfig;
32 35
import org.distorted.main.R;
33 36
import org.distorted.main.RubikActivity;
34 37

  
......
43 46

  
44 47
    if( diag!=null )
45 48
      {
46
      diag.dismiss();
49
      try
50
        {
51
        diag.dismiss();
52
        }
53
      catch(IllegalStateException ex)
54
        {
55
        if( !BuildConfig.DEBUG )
56
          {
57
          FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
58
          crashlytics.setCustomKey("MainDialog", ex.toString());
59
          crashlytics.recordException(ex);
60
          }
61
        }
47 62
      }
48 63
    else
49 64
      {
50
      android.util.Log.e("act", "cannot find main dialog!");
65
      if( !BuildConfig.DEBUG )
66
        {
67
        Exception ex = new Exception("Cannot find MainDialog");
68
        FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
69
        crashlytics.setCustomKey("MainDialog", ex.toString());
70
        crashlytics.recordException(ex);
71
        }
51 72
      }
52 73
    }
53 74

  

Also available in: Unified diff