我想在“活动”中显示移动图库中的图片,但我的版本低于“错误”。
错误日志:
ExifInterface: Invalid image.java.io.IOException: Invalid marker: 89
at android.media.ExifInterface.getJpegAttributes(ExifInterface.java:1607)
at android.media.ExifInterface.loadAttributes(ExifInterface.java:1335)
at android.media.ExifInterface.<init>(ExifInterface.java:1052)
at com.squareup.picasso.FileRequestHandler.getFileExifRotation(FileRequestHandler.java:46)
at com.squareup.picasso.FileRequestHandler.load(FileRequestHandler.java:42)
at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:206)
at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:159)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:411)
我要显示图像的片段:我也创建了适配器类
super.onActivityCreated(savedInstanceState);
mGroupMedia = (GroupMedia) getActivity();
imageFileList = new ArrayList<>();
//Get Data
GROUP_ID = mGroupMedia.getIntent().getStringExtra("GROUP_ID");
IS_ADMIN = mGroupMedia.getIntent().getStringExtra("IS_ADMIN");
GROUP_NAME = mGroupMedia.getIntent().getStringExtra("GROUP_NAME");
realm = Realm.getDefaultInstance();
mCurrentGroup = RealmController.with(this).getGroup(Integer.parseInt(GROUP_ID));
groupsMessages = new ArrayList<>();
RealmResults<GroupMessages> x_groupsMessages = RealmController.with(mGroupMedia).getAllGroupMessages(Integer.parseInt(GROUP_ID));
groupsMessages.addAll(x_groupsMessages);
mProgressDialog = new ProgressDialog(mGroupMedia);
mProgressDialog.setCancelable(true);
final File Folder = new File(Environment.getExternalStorageDirectory()+"/folder");
final File videosFolder = new File(Environment.getExternalStorageDirectory()+"/folder/Images");
final File grouopFolder = new File(Environment.getExternalStorageDirectory()+"/folder/Images/"+GROUP_NAME);
for(int i=0; i<groupsMessages.size(); i++){
final File videoFile = new File(Environment.getExternalStorageDirectory()+"/folder/Images/"+GROUP_NAME+"/"+groupsMessages.get(i).getLink());
if(Folder.exists() && videosFolder.exists() && grouopFolder.exists() && videoFile.exists()){
if(!groupsMessages.get(i).getLink().trim().equals("")) {
imageFileList.add(groupsMessages.get(i));
Log.e("Video", "Video : " + videoFile.getAbsolutePath() + "");
}
}
}
Log.e("Video","Size : "+imageFileList.size());
//Send data to VideoListAdapter
imageFragmentGVAdapter = new ImageFragmentGVAdapter(mGroupMedia, imageFileList, GROUP_NAME);
photosGridView.setAdapter(imageFragmentGVAdapter);
在适配器类中我正在使用网格布局创建视图