summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-07-31 16:28:17 -0700
committerGrace Kloba <klobag@google.com>2009-07-31 16:28:17 -0700
commita34f686112fb4f9fbea00b8c2c47153d34e93e41 (patch)
tree0f8c0036e202f56dd2aca110c78a84071931dee0
parentcc63403643786905262f505ab5266d8e80b9924c (diff)
downloadpackages_apps_Browser-a34f686112fb4f9fbea00b8c2c47153d34e93e41.zip
packages_apps_Browser-a34f686112fb4f9fbea00b8c2c47153d34e93e41.tar.gz
packages_apps_Browser-a34f686112fb4f9fbea00b8c2c47153d34e93e41.tar.bz2
Move IntentFilter/BroadcastReceiver creation before the spot where we may
early bail out in onCreate(). This should avoid the NPE we saw in onResume.
-rw-r--r--src/com/android/browser/BrowserActivity.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index c19bd37..93ba1b1 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -685,6 +685,23 @@ public class BrowserActivity extends Activity
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Browser");
+ /* enables registration for changes in network status from
+ http stack */
+ mNetworkStateChangedFilter = new IntentFilter();
+ mNetworkStateChangedFilter.addAction(
+ ConnectivityManager.CONNECTIVITY_ACTION);
+ mNetworkStateIntentReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent.getAction().equals(
+ ConnectivityManager.CONNECTIVITY_ACTION)) {
+ boolean down = intent.getBooleanExtra(
+ ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
+ onNetworkToggle(!down);
+ }
+ }
+ };
+
// If this was a web search request, pass it on to the default web search provider.
if (handleWebSearchIntent(getIntent())) {
moveTaskToBack(true);
@@ -748,23 +765,6 @@ public class BrowserActivity extends Activity
// are not animating from the tab picker.
attachTabToContentView(mTabControl.getCurrentTab());
}
-
- /* enables registration for changes in network status from
- http stack */
- mNetworkStateChangedFilter = new IntentFilter();
- mNetworkStateChangedFilter.addAction(
- ConnectivityManager.CONNECTIVITY_ACTION);
- mNetworkStateIntentReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (intent.getAction().equals(
- ConnectivityManager.CONNECTIVITY_ACTION)) {
- boolean down = intent.getBooleanExtra(
- ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
- onNetworkToggle(!down);
- }
- }
- };
}
@Override