From 1cbd7eecc78a4bb47b10c035ba7abff528a3b207 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Wed, 1 Mar 2017 00:43:46 -0500 Subject: [PATCH] Keep Volley from leaking requests between activities and add a forgotten license notice. --- .../com/keylesspalace/tusky/ReportActivity.java | 10 ++++++++-- .../com/keylesspalace/tusky/ReportAdapter.java | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java b/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java index e32002bc..35c71bf2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java @@ -49,7 +49,7 @@ import java.util.List; import java.util.Map; public class ReportActivity extends BaseActivity { - private static final String TAG = "ReportActivity"; // Volley request tag + private static final String TAG = "ReportActivity"; // logging tag and Volley request tag private String domain; private String accessToken; @@ -117,8 +117,14 @@ public class ReportActivity extends BaseActivity { fetchRecentStatuses(accountId); } + @Override + protected void onDestroy() { + VolleySingleton.getInstance(this).cancelAll(TAG); + super.onDestroy(); + } + /* JSONArray has a constructor to take primitive arrays but it's restricted to API level 19 and - * above, so this is an alternative. */ + * above, so this is an alternative. */ private static JSONArray makeStringArrayCompat(String[] stringArray) throws JSONException { JSONArray result = new JSONArray(); for (int i = 0; i < stringArray.length; i++) { diff --git a/app/src/main/java/com/keylesspalace/tusky/ReportAdapter.java b/app/src/main/java/com/keylesspalace/tusky/ReportAdapter.java index 672376e5..9f6153a6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ReportAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/ReportAdapter.java @@ -1,3 +1,18 @@ +/* Copyright 2017 Andrew Dawson + * + * This file is part of Tusky. + * + * Tusky is free software: you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * Tusky 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 for more details. + * + * You should have received a copy of the GNU General Public License along with Tusky. If not, see + * . */ + package com.keylesspalace.tusky; import android.support.v7.widget.RecyclerView;