我想显示操作栏
在返回按钮
移动previous页/活动或到主页(第一开口)。
我不能做到这一点。
I'm trying to display a Back button
on the Action bar
to move previous page/activity or to the main page (first opening).
And I can not do it.
我的code。
ActionBar actionBar = getActionBar();
actionBar.setHomeButtonEnabled(true);
在code是在的onCreate
。
嗯,这是简单的显示后退按钮
well this is simple one to show back button
actionBar.setDisplayHomeAsUpEnabled(true);
然后就可以自定义在onOptionsItemSelected后面的事件
and then you can custom the back event at onOptionsItemSelected
case android.R.id.home:
this.finish();
return true;