使用 MediaPlayer 播放手机 SD 卡中的音频资源
1、截图
第一次运行时需要在音乐列表中选择一个要播放的音频,长按列表项即可
(ListView 设置了长按监听)
2、布局文件
<?xml version ="1.0" encoding ="utf-8" ?>
<LinearLayout
xmlns:android ="http://schemas.android.com/apk/res/android"
android:orientation ="vertical"
android:layout_width ="fill_parent"
android:layout_height ="fill_parent"
>
<TextView
android:layout_width ="fill_parent"
android:layout_height ="wrap_content"
android:text ="@string/hello_world" />
<LinearLayout
评论0
最新资源