]> git.ktnx.net Git - mobile-ledger-staging.git/commitdiff
move AsyncCrasher in its own file
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Nov 2019 10:54:47 +0000 (12:54 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Nov 2019 10:54:47 +0000 (12:54 +0200)
avoids implicit reference to parent activity class which may lead to
memory leaks

app/src/main/java/net/ktnx/mobileledger/ui/activity/AsyncCrasher.java [new file with mode: 0644]
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java

diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/AsyncCrasher.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/AsyncCrasher.java
new file mode 100644 (file)
index 0000000..ce02ff5
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright © 2019 Damyan Ivanov.
+ * This file is part of MoLe.
+ * MoLe is free software: you can distribute it and/or modify it
+ * under the term of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your opinion), any later version.
+ *
+ * MoLe is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License terms for details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MoLe. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package net.ktnx.mobileledger.ui.activity;
+
+import android.os.AsyncTask;
+
+class AsyncCrasher extends AsyncTask<Void, Void, Void> {
+    @Override
+    protected Void doInBackground(Void... voids) {
+        throw new RuntimeException("Simulated crash");
+    }
+}
index 1317c438f334e759756ed00194e6b07ccadb3ce7..d506ac35ab994f65397c3317779bd2a8e481ff9a 100644 (file)
@@ -17,7 +17,6 @@
 
 package net.ktnx.mobileledger.ui.activity;
 
-import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.TypedValue;
 import android.view.Menu;
@@ -160,11 +159,4 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas
         model.toggleSimulateSave();
     }
 
-    private class AsyncCrasher extends AsyncTask<Void, Void, Void> {
-        @Override
-        protected Void doInBackground(Void... voids) {
-            throw new RuntimeException("Simulated crash");
-        }
-    }
-
 }