don't crash when crashlytics didn't get built in correctly

This commit is contained in:
Eric House 2017-06-27 07:34:04 -07:00
parent d454ffb3e8
commit 33838e6a14

View file

@ -31,27 +31,30 @@ public class CrashTrack {
private static final String TAG = CrashTrack.class.getSimpleName();
public static void init( Context context ) {
if ( 0 < BuildConfig.FABRIC_API_KEY.length() ) {
// Crashlytics/Fabric sample code wants this between onCreate()'s
// super() call and the call to setContentView(). We'll see if
// this works.
Fabric.with( context, new Crashlytics() );
try {
Fabric.with( context, new Crashlytics() );
// Now crash as a test
if ( false ) {
new Thread( new Runnable() {
@Override
public void run() {
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {}
String nullStr = null;
if ( nullStr.equals("") ) {
Log.d( TAG, "something's very wrong" );
// Now crash as a test
if ( false ) {
new Thread( new Runnable() {
@Override
public void run() {
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {}
String nullStr = null;
if ( nullStr.equals("") ) {
Log.d( TAG, "something's very wrong" );
}
}
}
} ).start();
} ).start();
}
} catch ( Exception ex ) {
Log.d( TAG, "problem initing crashlytics" );
}
}
}