android播放音乐示例(3)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:13 点击:次
private ImageButton mNextImageButton = null;
/* MediaPlayer对象 */
public MediaPlayer mMediaPlayer = null;
/* 播放列表 */
private List<String> mMusicList = new ArrayList<String>();
/* 当前播放歌曲的索引 */
private int currentListItme = 0;
/* 音乐的路径 */
private static final String MUSIC_PATH = new String("/sdcard/");
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/* 更新显示播放列表 */
musicList();
/* 构建MediaPlayer对象 */
mMediaPlayer = new MediaPlayer();
mFrontImageButton = (ImageButton) findViewById(R.id.LastImageButton);
mStopImageButton = (ImageButton) findViewById(R.id.StopImageButton);
mStartImageButton = (ImageButton) findViewById(R.id.StartImageButton);
mPauseImageButton = (ImageButton) findViewById(R.id.PauseImageButton);
mNextImageButton = (ImageButton) findViewById(R.id.NextImageButton);
//停止按钮
mStopImageButton.setOnClickListener(new ImageButton.OnClickListener()
{
@Override
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>