我有一个带有吸引力的MainActivity.java和它的听众
toggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close){
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
}
/** Called when a drawer has settled in a completely closed state. */
@Override
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
FloatingButton.getInstance(context).showFloatingActionButton();
}
/** Called when a drawer has settled in a completely open state. */
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
FloatingButton.getInstance(context).hideFloatingActionButton();
}
};
我只能从MainActivity
访问它而且我还有10个片段。我需要从每个片段访问此侦听器。
任何想法如何? Thx提前!