这是我的第一个应用程序,所以我不习惯在java上编码.
我有一个gridview,它显示了sdcard的缩略图,但我无法顺利滚动.
如果我把/*处理部分*/放出如果滚动就像我想要的那样但它们是重复的内容并且不显示部分图片.
这是我的代码:
-活动:
GridView gridview = (GridView) findViewById(R.id.gridview1);
String[] projection = {MediaStore.Images.Media._ID};
String path ="/mnt/sdcard/Pictures";
// Create the cursor pointing to the SDCard
cursor = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
projection,
//MediaStore.Images.Media.DATA + " like ? ",
//new String[] {"%Pictures%Sopi%"},
"_data LIKE '%" + path + "/%'",
null,
MediaStore.Images.Media._ID);
// Get the column index of the Media Image ID
columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media._ID);
gridview.setAdapter(new ImageAdapterTest(RoomRawActivity.this));
Run Code Online (Sandbox Code Playgroud)
-imageAdapater(获取视图):
public View getView(int position, View convertView, ViewGroup parent) {
Log.v("adapter - getView","getView start!!");
//Toast.makeText(mContext, "getView start!!"+position, …Run Code Online (Sandbox Code Playgroud)