Added debug info to setup

pull/177/head
M66B 5 years ago
parent 6ba6188d95
commit d25834cd27

@ -239,6 +239,12 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
drawerLayout.closeDrawer(drawerContainer);
onMenuFAQ();
}
}, new Runnable() {
@Override
public void run() {
drawerLayout.closeDrawer(drawerContainer);
onDebugInfo();
}
}).setExternal(true));
menus.add(new NavMenuItem(R.drawable.baseline_account_box_24, R.string.menu_privacy, new Runnable() {
@ -448,6 +454,31 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
Helper.viewFAQ(this, 0);
}
private void onDebugInfo() {
new SimpleTask<Long>() {
@Override
protected Long onExecute(Context context, Bundle args) throws IOException {
return Log.getDebugInfo(context, R.string.title_debug_info_remark, null, null).id;
}
@Override
protected void onExecuted(Bundle args, Long id) {
startActivity(new Intent(ActivitySetup.this, ActivityCompose.class)
.putExtra("action", "edit")
.putExtra("id", id));
}
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
ToastEx.makeText(ActivitySetup.this, ex.getMessage(), Toast.LENGTH_LONG).show();
else
Log.unexpectedError(getSupportFragmentManager(), ex);
}
}.execute(this, new Bundle(), "debug:info");
}
private void onMenuPrivacy() {
Bundle args = new Bundle();
args.putString("name", "PRIVACY.md");

@ -1085,7 +1085,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (ex instanceof IllegalArgumentException)
ToastEx.makeText(ActivityView.this, ex.getMessage(), Toast.LENGTH_LONG).show();
else
ToastEx.makeText(ActivityView.this, ex.toString(), Toast.LENGTH_LONG).show();
Log.unexpectedError(getSupportFragmentManager(), ex);
}
}.execute(this, new Bundle(), "debug:info");

Loading…
Cancel
Save