Handle start activity exceptions

This commit is contained in:
M66B
2020-07-03 17:49:01 +02:00
parent 128f718829
commit dd960c39a4
2 changed files with 12 additions and 0 deletions

View File

@@ -388,6 +388,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
} catch (ActivityNotFoundException ex) {
Log.w(ex);
ToastEx.makeText(this, getString(R.string.title_no_viewer, intent), Toast.LENGTH_LONG).show();
} catch (Throwable ex) {
Log.e(ex);
ToastEx.makeText(this, Log.formatThrowable(ex), Toast.LENGTH_LONG).show();
}
}
@@ -398,6 +401,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
} catch (ActivityNotFoundException ex) {
Log.w(ex);
ToastEx.makeText(this, getString(R.string.title_no_viewer, intent), Toast.LENGTH_LONG).show();
} catch (Throwable ex) {
Log.e(ex);
ToastEx.makeText(this, Log.formatThrowable(ex), Toast.LENGTH_LONG).show();
}
}