Q1: how to get the media information of all the video in sd card getting the Image, Title, and Artist of the video and put it in my custom list adapter that acept and Array of Image, Array of Titles, Array of Artist, How to do that?
Thanks!
My Custom List Adapter Class - accept array of img from video, titles, artist
[HIGH]class MyCustomAdapter extends ArrayAdapter<String> {
Context context;
int[] imgArray;
String[] titlesArray;
String[] infoArray;
public MyCustomAdapter(Context context, int[] img, String[] titles,
String[] artist) {
super(context, R.layout.frag_row_items, R.id.textView1, titles);
this.context = context;
this.imgArray = img;
this.titlesArray = titles;
this.infoArray = titles;
}[/HIGH]
Fragment Class that instantiate the Custom Adapter Class
[HIGH]class FragmentExample extends ListFragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
String[] columns = { MediaStore.Video.Media.TITLE,
MediaStore.Video.Media.ARTIST };
Cursor cursor = getActivity().getContentResolver().query(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, columns, null,
null, null);
// how to put put the img of video, title and artist to the adapter class
// from the sdcard and put it in my Custom adapter class
MyCustomAdapter adapter = new MyCustomAdapter(getActivity(), myImage,
myTitle, myInfo);
setListAdapter(adapter);[/HIGH]
Thanks!
My Custom List Adapter Class - accept array of img from video, titles, artist
[HIGH]class MyCustomAdapter extends ArrayAdapter<String> {
Context context;
int[] imgArray;
String[] titlesArray;
String[] infoArray;
public MyCustomAdapter(Context context, int[] img, String[] titles,
String[] artist) {
super(context, R.layout.frag_row_items, R.id.textView1, titles);
this.context = context;
this.imgArray = img;
this.titlesArray = titles;
this.infoArray = titles;
}[/HIGH]
Fragment Class that instantiate the Custom Adapter Class
[HIGH]class FragmentExample extends ListFragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
String[] columns = { MediaStore.Video.Media.TITLE,
MediaStore.Video.Media.ARTIST };
Cursor cursor = getActivity().getContentResolver().query(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, columns, null,
null, null);
// how to put put the img of video, title and artist to the adapter class
// from the sdcard and put it in my Custom adapter class
MyCustomAdapter adapter = new MyCustomAdapter(getActivity(), myImage,
myTitle, myInfo);
setListAdapter(adapter);[/HIGH]