package net.ktnx.mobileledger.ui.activity;
+import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
+import static net.ktnx.mobileledger.utils.Logger.debug;
+
public abstract class CrashReportingActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
public void uncaughtException(Thread t, Throwable e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
+
+ pw.format("OS version: %s; API level %d\n\n", Build.VERSION.RELEASE,
+ Build.VERSION.SDK_INT);
e.printStackTrace(pw);
Log.e(null, sw.toString());
df.show(getSupportFragmentManager(), "crash_report");
}
});
- Log.d("crash", "Uncaught exception handler set");
+ debug("crash", "Uncaught exception handler set");
}
}