mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
don't crash when crashlytics didn't get built in correctly
This commit is contained in:
parent
d454ffb3e8
commit
33838e6a14
1 changed files with 18 additions and 15 deletions
|
@ -31,27 +31,30 @@ public class CrashTrack {
|
||||||
private static final String TAG = CrashTrack.class.getSimpleName();
|
private static final String TAG = CrashTrack.class.getSimpleName();
|
||||||
|
|
||||||
public static void init( Context context ) {
|
public static void init( Context context ) {
|
||||||
|
|
||||||
if ( 0 < BuildConfig.FABRIC_API_KEY.length() ) {
|
if ( 0 < BuildConfig.FABRIC_API_KEY.length() ) {
|
||||||
// Crashlytics/Fabric sample code wants this between onCreate()'s
|
// Crashlytics/Fabric sample code wants this between onCreate()'s
|
||||||
// super() call and the call to setContentView(). We'll see if
|
// super() call and the call to setContentView(). We'll see if
|
||||||
// this works.
|
// this works.
|
||||||
Fabric.with( context, new Crashlytics() );
|
try {
|
||||||
|
Fabric.with( context, new Crashlytics() );
|
||||||
|
|
||||||
// Now crash as a test
|
// Now crash as a test
|
||||||
if ( false ) {
|
if ( false ) {
|
||||||
new Thread( new Runnable() {
|
new Thread( new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
} catch (InterruptedException ex) {}
|
} catch (InterruptedException ex) {}
|
||||||
String nullStr = null;
|
String nullStr = null;
|
||||||
if ( nullStr.equals("") ) {
|
if ( nullStr.equals("") ) {
|
||||||
Log.d( TAG, "something's very wrong" );
|
Log.d( TAG, "something's very wrong" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} ).start();
|
||||||
} ).start();
|
}
|
||||||
|
} catch ( Exception ex ) {
|
||||||
|
Log.d( TAG, "problem initing crashlytics" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue