2012-11-07 277 views
1

我對此很新,我在這裏的論壇上查了一個答案,但是我沒有找到任何可以真正幫助我的答案。我正嘗試從res/raw文件夾播放視頻。我已經建立了這個代碼至今:Eclipse視頻意圖視頻

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); 
     } 
    } 
    }); 
    } 
+0

更新;如果我不清楚我需要什麼幫助,我需要從資源文件播放視頻,並添加(顯然)一種方法來做到這一點。我提前感謝你們! – user1805959

回答