From 526b3c1befa3ed86726c8569eee7a3417b5546eb Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 14 Feb 2011 18:12:46 -0800 Subject: [PATCH] register receiver with app context rather than a single activity's so that it doesn't leak when that activity goes away. --- .../XWords4/src/org/eehouse/android/xw4/NetStateCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java index 6b7af63c8..11bbafb60 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java @@ -80,8 +80,8 @@ public class NetStateCache { IntentFilter filter = new IntentFilter(); filter.addAction( ConnectivityManager.CONNECTIVITY_ACTION ); - Intent intent = context.registerReceiver( s_receiver, - filter ); + Intent intent = context.getApplicationContext(). + registerReceiver( s_receiver, filter ); s_ifs = new HashSet(); s_haveReceiver = true;