Queria saber a ver si es posible como hacer un array de videos, tengo una aplicacion con un grid view y cada elemento del gridview abre un video, he creado un videoAdapter,pero con setVideoUri cuando pongo el array de videos Uri[], me sale un erro y quiere convertirme a int los uri.
Dejo el codigo.
////////////////////////////////////////////////////////////////
public class VideoFull extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.video_full);
int i = getIntent().getExtras().getInt("id");
new VideoAdapter(this);
VideoView videoView = (VideoView) findViewById(R.id.videofull);
videoView.setVideoURI(VideoAdapterfull.vidTest[i]);
videoView.setMediaController(new MediaController(this));
videoView.requestFocus();
videoView.start();
}
}
////////////////////////////////////////////////////////////////
public class VideoAdapterfull extends BaseAdapter {
private Context mContext;
static Uri[] vidTest = {R.raw.vid1, R.raw.vid2};
public VideoAdapterfull(Context c) {
mContext = c;
}
public int getCount() {
return vidTest.length;
}
public Object getItem(int position) {
return null;
}
public long getItemId(int position) {
return 0;
}
public View getView(int position, View paramView, ViewGroup paramViewGroup) {
VideoView videoView = new VideoView(this.mContext);
videoView.setVideoURI(vidTest[position]);
return videoView;
}
}