我对此很陌生,我在这里的论坛上检查了答案,但我没有找到任何可以真正帮助我的答案。我正在尝试播放 res/raw 文件夹中的视频。到目前为止,我已经设置了此代码:
MediaPlayer mp;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videoview);
ListView l1 = (ListView) findViewById(R.id.listview);
l1.setAdapter(new EfficientAdapter(this));
l1.setOnItemClickListener(new OnItemClickListener() {
//Starts up a new activity, based on what listitem you press.
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Intent intent = new Intent(VideoButtonActivity.this, com.example.norskattrack.VideoActivity.class);
if(position==0){
System.out.println("Item 0");
intent.putExtra("video", 1);
startActivity(intent);
}
if(position==1){
System.out.println("Item 1");
intent.putExtra("video", 2);
startActivity(intent);
}
}
});
}