MCPcopy Create free account
hub / github.com/cinit/TMoe / showImpl

Method showImpl

app/src/main/java/cc/ioctl/tmoe/ui/util/FaultyDialog.java:46–60  ·  view source on GitHub ↗
(@NonNull Context ctx, @NonNull String title, @NonNull Throwable e, boolean cancelable)

Source from the content-addressed store, hash-verified

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);

Callers 1

showMethod · 0.95

Calls 4

getStackTraceStringMethod · 0.95
setTitleMethod · 0.65
showMethod · 0.45

Tested by

no test coverage detected