diff --git a/app/src/main/java/eu/faircode/email/ActivityAnswer.java b/app/src/main/java/eu/faircode/email/ActivityAnswer.java
index 1041a31c67..4f52cbbdd4 100644
--- a/app/src/main/java/eu/faircode/email/ActivityAnswer.java
+++ b/app/src/main/java/eu/faircode/email/ActivityAnswer.java
@@ -35,9 +35,13 @@ import android.widget.Toast;
import androidx.annotation.RequiresApi;
import androidx.constraintlayout.widget.Group;
+import java.util.Date;
import java.util.List;
+import java.util.concurrent.ExecutorService;
public class ActivityAnswer extends ActivityBase {
+ private static ExecutorService executor = Helper.getBackgroundExecutor(1, "answer");
+
@Override
@RequiresApi(api = Build.VERSION_CODES.M)
protected void onCreate(Bundle savedInstanceState) {
@@ -55,14 +59,27 @@ public class ActivityAnswer extends ActivityBase {
lvAnswer.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> adapterView, View view, int pos, long id) {
+ final Context context = adapterView.getContext();
EntityAnswer answer = (EntityAnswer) adapterView.getAdapter().getItem(pos);
+ executor.submit(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ DB db = DB.getInstance(context);
+ db.answer().applyAnswer(answer.id, new Date().getTime());
+ } catch (Throwable ex) {
+ Log.e(ex);
+ }
+ }
+ });
+
String html = answer.getHtml(null);
- String text = HtmlHelper.getText(ActivityAnswer.this, html);
+ String text = HtmlHelper.getText(context, html);
ClipboardManager cbm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
cbm.setPrimaryClip(ClipData.newHtmlText(getString(R.string.app_name), text, html));
- ToastEx.makeText(ActivityAnswer.this, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
+ ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
Intent intent = getIntent();
if (intent != null) {
diff --git a/app/src/main/java/eu/faircode/email/AdapterAnswer.java b/app/src/main/java/eu/faircode/email/AdapterAnswer.java
index f68a13e748..b17ffe7240 100644
--- a/app/src/main/java/eu/faircode/email/AdapterAnswer.java
+++ b/app/src/main/java/eu/faircode/email/AdapterAnswer.java
@@ -72,6 +72,7 @@ public class AdapterAnswer extends RecyclerView.Adapter
@@ -37,7 +37,7 @@
android:maxLines="1"
android:text="Group"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
- app:layout_constraintEnd_toStartOf="@+id/ivReceipt"
+ app:layout_constraintEnd_toStartOf="@+id/ivExternal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvName" />
@@ -61,6 +61,15 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvGroup" />
+
+