Merge branch 'simplify-crash-activity' into 'master'
Fix crash report activity theme and behavior Use proper theme, fix crash on sending and comment loss on device rotation. See merge request !191
This commit is contained in:
commit
9aca7da375
@ -378,7 +378,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.fdroid.fdroid.CrashReportActivity"
|
||||
android:theme="@style/AlertDialogThemeDark"
|
||||
android:theme="@style/AppThemeDark"
|
||||
android:process=":error_report"
|
||||
android:launchMode="singleInstance"
|
||||
android:excludeFromRecents="true"
|
||||
|
@ -9,6 +9,9 @@ import org.acra.BaseCrashReportDialog;
|
||||
|
||||
public class CrashReportActivity extends BaseCrashReportDialog implements DialogInterface.OnDismissListener, DialogInterface.OnClickListener {
|
||||
|
||||
private static final String STATE_COMMENT = "comment";
|
||||
private EditText comment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -23,6 +26,11 @@ public class CrashReportActivity extends BaseCrashReportDialog implements Dialog
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.setOnDismissListener(this);
|
||||
dialog.show();
|
||||
|
||||
comment = (EditText) dialog.findViewById(android.R.id.input);
|
||||
if (savedInstanceState != null) {
|
||||
comment.setText(savedInstanceState.getString(STATE_COMMENT));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -33,12 +41,16 @@ public class CrashReportActivity extends BaseCrashReportDialog implements Dialog
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (which == DialogInterface.BUTTON_POSITIVE) {
|
||||
final String comment = ((EditText) findViewById(android.R.id.input)).getText().toString();
|
||||
sendCrash(comment, "");
|
||||
sendCrash(comment.getText().toString(), "");
|
||||
} else {
|
||||
cancelReports();
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
outState.putString(STATE_COMMENT, comment.getText().toString());
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user