diff options
author | Fup Duck <fupduck@sacknagel.com> | 2018-03-23 18:55:05 +0100 |
---|---|---|
committer | Fup Duck <fupduck@sacknagel.com> | 2018-03-23 18:55:05 +0100 |
commit | 0e77f2c8d772b07f7b16d35c67cdb254ad648e48 (patch) | |
tree | 7a143334477e8eb76146be6db9bc4caf826b71ce /app/src/main/java | |
parent | 1faf9f6eaaae5adc5f020607d439ab70ec5378e4 (diff) |
8876 - move broadcastreceiver to onResume
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/MainActivity.java | 4 |
1 files changed, 2 insertions, 2 deletions
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(); } |