From 0e77f2c8d772b07f7b16d35c67cdb254ad648e48 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Fri, 23 Mar 2018 18:55:05 +0100 Subject: 8876 - move broadcastreceiver to onResume --- app/src/main/java/se/leap/bitmaskclient/MainActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/se/leap') diff --git a/app/src/main/java/se/leap/bitmaskclient/MainActivity.java b/app/src/main/java/se/leap/bitmaskclient/MainActivity.java index 33ecf85a..e40d329c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/MainActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/MainActivity.java @@ -86,7 +86,6 @@ public class MainActivity extends AppCompatActivity { setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); mainActivityBroadcastReceiver = new MainActivityBroadcastReceiver(); - setUpBroadcastReceiver(); navigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer); @@ -104,6 +103,7 @@ public class MainActivity extends AppCompatActivity { @Override protected void onResume() { + setUpBroadcastReceiver(); super.onResume(); } @@ -205,12 +205,12 @@ public class MainActivity extends AppCompatActivity { @Override protected void onPause() { + LocalBroadcastManager.getInstance(this).unregisterReceiver(mainActivityBroadcastReceiver); super.onPause(); } @Override protected void onDestroy() { - LocalBroadcastManager.getInstance(this).unregisterReceiver(mainActivityBroadcastReceiver); mainActivityBroadcastReceiver = null; super.onDestroy(); } -- cgit v1.2.3