(@NonNull Context ctx, @NonNull String title, @NonNull Throwable e, boolean cancelable)
| 44 | } |
| 45 | |
| 46 | private static void showImpl(@NonNull Context ctx, @NonNull String title, @NonNull Throwable e, boolean cancelable) { |
| 47 | Context c = CommonContextWrapper.createAppCompatContext(ctx); |
| 48 | String msg = Log.getStackTraceString(e); |
| 49 | new AlertDialog.Builder(c) |
| 50 | .setTitle(title) |
| 51 | .setMessage(msg) |
| 52 | .setCancelable(cancelable) |
| 53 | .setPositiveButton(android.R.string.ok, null) |
| 54 | .setNeutralButton(android.R.string.copy, (dialog, which) -> { |
| 55 | ClipboardManager clipboard = (ClipboardManager) c.getSystemService(Context.CLIPBOARD_SERVICE); |
| 56 | ClipData clip = ClipData.newPlainText("error", msg); |
| 57 | clipboard.setPrimaryClip(clip); |
| 58 | }) |
| 59 | .show(); |
| 60 | } |
| 61 | |
| 62 | private static void showImpl(@NonNull Context ctx, @NonNull String title, @NonNull CharSequence msg, boolean cancelable) { |
| 63 | Context c = CommonContextWrapper.createAppCompatContext(ctx); |
no test coverage detected