Skip to content

Commit

Permalink
move receiver to onCreateOptionsMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
yulin2 committed May 31, 2015
1 parent 8340317 commit 0cb7d85
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public class ProgressMenuItemActivity extends ActionBarActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.progress_menu_item_activity_main);
reloadReceiver = new ReloadReceiver(progressHelper);
LocalBroadcastManager.getInstance(this)
.registerReceiver(reloadReceiver, new IntentFilter(RELOAD_FILTER));
}

@Override
Expand All @@ -43,6 +40,9 @@ public void onDestroy() {
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.progress_menu_item_refresh_menu, menu);
progressHelper = new ProgressMenuItemHelper(menu, R.id.action_refresh, ProgressMenuItemSize.LARGE);
reloadReceiver = new ReloadReceiver(progressHelper);
LocalBroadcastManager.getInstance(this)
.registerReceiver(reloadReceiver, new IntentFilter(RELOAD_FILTER));
return true;
}

Expand All @@ -63,4 +63,4 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
}

}
}

0 comments on commit 0cb7d85

Please sign in to comment.