I m currently working on a mp3 library on Android. Thing is, there are 4 tab, representing Songs, Albums, Artists and Playlists. My main activity creates a tabspec for each tab and add them to a tabhost. The problem is, I can t use the ActionBar. I tried the tutorial from Android Developpers and it works fine, however when I try to apply it on my project it doesn t work. I can t see the actionbar and if I try a getActionBar() in my activity it returns null.
正如在教程里我把这个代码 输入到活动中:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.actionbar_menu, menu);
return true;
}
我创造了这个菜单:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_save"
android:title="Hello !"
android:showAsAction="ifRoom" />
</menu>
我想为了显示动作栏,还有很多事情要做, 但我现在无法在网络上找到准确的信息...这和我的主要活动Xml有关吗?
谢谢大家的注意