aaa.jpg

구현하고자 하는것이 핸드폰에 있는 동영상파일을 불러와

갤러리 형태로 미리보기화면을 뿌려주는것입니다..

위에 그림처럼 동영상 파일의 처음화면이 나타나게하는것입니다.

갤러리 기본어플에 있는 것처럼 이미지 뷰랑 똑같은 형태로 갤러리에들어가는데

어떻 뷰를 생성해야 되는지 알고싶습ㄴ디ㅏ

  public PublicMediaCursorAdpter(Context context, Cursor c,int nUriType) {
   super(context, c);
   this.Context = context;
   this.nUritype = nUriType;
  }
  @Override
  public void bindView(View view, Context context, Cursor cursor) {
   View row = view;
   Cursor mCur = cursor;
   switch(nUritype)
   {
    case MemoDatabase.TYPE_URI_IMAGE:
     ImageView Image = (ImageView)row.findViewById(R.id.gallery_row_imageview);
           Image.setScaleType(ImageView.ScaleType.FIT_XY); 
           Uri imageUri = ContentUris.withAppendedId(Media.EXTERNAL_CONTENT_URI,mCur.getLong(mCur.getColumnIndex(Media._ID)));
           Image.setImageURI(imageUri);
     break;
    case MemoDatabase.TYPE_URI_VIDEO:
     
     VideoView vImage = (VideoView)row.findViewById(R.id.gallery_row_videoview);
     //vImage.setScaleType(ImageView.ScaleType.FIT_XY);
     
           Uri vimageUri = ContentUris.withAppendedId(Video.Media.EXTERNAL_CONTENT_URI,mCur.getLong(mCur.getColumnIndex(Media._ID)));
           vImage.setVideoURI(vimageUri);
     break;
   }   
  }
  @Override
  public View newView(Context context, Cursor cursor, ViewGroup parent) {
   View row=null;;
   LayoutInflater inflater=((Activity) context).getLayoutInflater();
   switch(nUritype)
   {
    case MemoDatabase.TYPE_URI_IMAGE:
     row=inflater.inflate(R.layout.gallery_imageview_row, null);
     break;
    case MemoDatabase.TYPE_URI_VIDEO:
     row=inflater.inflate(R.layout.gallery_videoview_row, null);
     break;
   }  
  
  return row;
  }
   
  }


이 코드는 ImageView는 제대로 동작하는데

VideoView로 동일하게 작성햇더니 동영상 파일은 나타나지않습니다.ㅠㅠ