通过使用onItemClick和条件我匹配字符串数组与原始文件夹MP3文件我想通过点击列表视图歌曲我需要在其他活动通过调用只是该mplay方法播放歌曲。请帮助我....如果条件在Android
public void onItemClick(AdapterView<?> parent, View view, int position,long id)
{
Intent intent = new Intent(this, Play.class);
startActivity(intent);
MediaPlayer mPlayer2;
MediaPlayer mPlayer3;
if(position==0)
{
public void mplay() **<--------- I Get error in this Line**
{
mPlayer2= MediaPlayer.create(this, R.raw.gayatri);
mPlayer2.start();
}
}
这是一个语法错误。您不能在常规代码块中声明方法。也许学习JAVA语言教程? – 2013-04-04 06:41:34
在另一个Activity中调用一个方法只是:'Play.this.mplay()'并且该方法必须退出该活动 – tttony 2013-04-04 06:43:33