希望在Fragment 打开时,actionbar出现 返回的箭头 “<–” .
在onCreate()或onStart()中:
@Override
public void onStart() {
**setHasOptionsMenu(true);**//执行该方法,才会调用onOptionsItemSelected()
super.onStart();
ActionBar actionBar = getActivity().getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
我这里的需求是:将当前Fragment的抛出栈。
重写onOptionItemSeleted(MenuItem item)方法。
@Override
public boolean