From 91def72f0aa6171b836a33e5a7ff7dcbb3f9267a Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 4 Mar 2021 21:50:15 +0100 Subject: [PATCH] Collect garbage --- .../eu/faircode/email/FragmentOptionsMisc.java | 9 +++++++++ app/src/main/res/layout/fragment_options_misc.xml | 15 +++++++++++++-- app/src/main/res/values/strings.xml | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 68f7846e46..ac5738caad 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -121,6 +121,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private TextView tvMemoryUsage; private TextView tvStorageUsage; private TextView tvFingerprint; + private Button btnGC; private Button btnCharsets; private Button btnCiphers; private Button btnFiles; @@ -218,6 +219,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc tvMemoryUsage = view.findViewById(R.id.tvMemoryUsage); tvStorageUsage = view.findViewById(R.id.tvStorageUsage); tvFingerprint = view.findViewById(R.id.tvFingerprint); + btnGC = view.findViewById(R.id.btnGC); btnCharsets = view.findViewById(R.id.btnCharsets); btnCiphers = view.findViewById(R.id.btnCiphers); btnFiles = view.findViewById(R.id.btnFiles); @@ -527,6 +529,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + btnGC.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Runtime.getRuntime().gc(); + } + }); + btnCharsets.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 72b39109de..e5feb2d615 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -631,6 +631,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvStorageUsage" /> +