mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
Fix[dialog]: clipboard copies are no longer empty text
This commit is contained in:
parent
5cd0a70d0e
commit
84aca2e182
@ -1,10 +1,13 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.content.*;
|
||||
import android.os.*;
|
||||
import androidx.appcompat.app.*;
|
||||
import android.util.*;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class FatalErrorActivity extends AppCompatActivity {
|
||||
|
||||
@ -13,8 +16,13 @@ public class FatalErrorActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Bundle extras = getIntent().getExtras();
|
||||
boolean storageAllow = extras.getBoolean("storageAllow");
|
||||
final String stackTrace = Log.getStackTraceString((Throwable) extras.getSerializable("throwable"));
|
||||
if(extras == null) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
boolean storageAllow = extras.getBoolean("storageAllow", false);
|
||||
Throwable throwable = (Throwable) extras.getSerializable("throwable");
|
||||
final String stackTrace = throwable != null ? Tools.printToString(throwable) : "<null>";
|
||||
String strSavePath = extras.getString("savePath");
|
||||
String errHeader = storageAllow ?
|
||||
"Crash stack trace saved to " + strSavePath + "." :
|
||||
|
@ -600,7 +600,7 @@ public final class Tools {
|
||||
.setNegativeButton(showMore ? R.string.error_show_less : R.string.error_show_more, (p1, p2) -> showError(ctx, titleId, rolledMessage, e, exitIfOk, !showMore))
|
||||
.setNeutralButton(android.R.string.copy, (p1, p2) -> {
|
||||
ClipboardManager mgr = (ClipboardManager) ctx.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
mgr.setPrimaryClip(ClipData.newPlainText("error", Log.getStackTraceString(e)));
|
||||
mgr.setPrimaryClip(ClipData.newPlainText("error", printToString(e)));
|
||||
if(exitIfOk) {
|
||||
if (ctx instanceof MainActivity) {
|
||||
MainActivity.fullyExit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user