<TextView android:text="选项" android:id="@+id/select_item"
android:textSize="@dimen/music_list_title" android:textStyle="bold"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</TextView>
</LinearLayout>
<ListView android:id="@+id/menu" android:layout_width="wrap_content"
android:background="@drawable/list_item_bg" android:layout_height="wrap_content">
</ListView>
<TextView android:layout_width="wrap_content"
android:layout_height="50px"></TextView>
<LinearLayout android:layout_width="fill_parent" android:gravity="right"
android:layout_height="wrap_content" android:background="@drawable/footer_bar">
<ImageButton android:id="@+id/back"android:background="@drawable/back"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</ImageButton>
</LinearLayout>
</LinearLayout>
4.3.2 菜单功能实现
播放器菜单选择功能实现代码:
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
SharedPreferences sp=getSharedPreferences("MUSIC",MODE_WORLD_WRITEABLE);
SharedPreferences.Editor editor=sp.edit();
switch (arg2) {
case 0:
Intent intent_play = new Intent(Menu.this,
MainPlayActivity.class);
startActivity(intent_play);
Bundle bundle = new Bundle();
bundle.putInt("operate", 0);
Intent intent = new Intent();
intent.putExtras(bundle);
setResult(2, intent);
finish();
break;
case 2:
Intent intent_add = new Intent(Menu.this,
FileExplorerActivity.class);
editor.putString("SELECTNAME", null); 基于Android手机平台音乐播放器开发设计(12):http://www.751com.cn/jisuanji/lunwen_1408.html