Improved error handling

pull/214/head
M66B 2 years ago
parent 58ee954993
commit a6cd53b98d

@ -320,9 +320,27 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (view.getId() == R.id.btnHelp) if (view.getId() == R.id.btnHelp) {
int pos = getAdapterPosition();
TupleAccountEx account = (pos == RecyclerView.NO_POSITION ? null : items.get(pos));
if (account == null)
Helper.viewFAQ(context, 22); Helper.viewFAQ(context, 22);
else { else {
Intent intent = new Intent(context, ActivityError.class);
intent.putExtra("title", "Test");
intent.putExtra("message", account.error);
intent.putExtra("provider", account.provider);
intent.putExtra("account", account.id);
intent.putExtra("protocol", account.protocol);
intent.putExtra("auth_type", account.auth_type);
intent.putExtra("personal", "personal");
intent.putExtra("address", "address");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
return;
}
int pos = getAdapterPosition(); int pos = getAdapterPosition();
if (pos == RecyclerView.NO_POSITION) if (pos == RecyclerView.NO_POSITION)
return; return;
@ -371,7 +389,6 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
.putExtra("protocol", account.protocol)); .putExtra("protocol", account.protocol));
} }
} }
}
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {

Loading…
Cancel
Save