Comments (2)
@ZGaoFei
I've noticed this problem.
Quote from developer training:
Add the Photo to a Gallery
When you create a photo through an intent, you should know where your image is located, because you said where to save it in the first place. For everyone else, perhaps the easiest way to make your photo accessible is to make it accessible from the system's Media Provider.Note: If you saved your photo to the directory provided by getExternalFilesDir(), the media scanner cannot access the files because they are private to your app.
The following example method demonstrates how to invoke the system's media scanner to add your photo to the Media Provider's database, making it available in the Android Gallery application and to other apps.
private void galleryAddPic() {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
File f = new File(mCurrentPhotoPath);
Uri contentUri = Uri.fromFile(f);
mediaScanIntent.setData(contentUri);
this.sendBroadcast(mediaScanIntent);
}
Matisse doesn't send this broadcast for now.
And I also encountered a Loader mechanism which I was not sure why:
AlbumLoader
and AlbumMediaLoader
would load data multiple times on some phones which caused the media list to flash. So as a dirty fix, I overrode onContentChanged()
.
Anyway, I'll see if we can fix this.
from matisse.
谢谢及时回复……
是的,通过发送广播的确可以解决这个问题,当然我们也知道图片保存的位置,我们也是这样做的。
对于最后的“AlbumLoader and AlbumMediaLoader would load data multiple times on some phones which caused the media list to flash. ”暂时还没有遇到,我会注意这点
from matisse.
Related Issues (20)
- Camera is getting crashed please check this issue and fix asap.
- 图片横竖屏切换,会无法再显示图片相册内容,并且选择图片其他的分类相册也无法显示
- 切换到其他相册,一片空白,没有显示照片 HOT 15
- File Not show such as .pdf, . xls, . txt, . Doc in android 11 HOT 1
- 请问还会继续更新维护吗?
- The images do not show in android 10 and android R (11).
- Will this library be maintained?
- Mi Note 3 ,Android9读取相册崩溃
- Cannot access camera in Android OS 12 HOT 4
- Matisse error app crashes- android.content.ActivityNotFoundException: Unable to find explicit activity class HOT 1
- 同时限制图片数量和视频数量不起作用
- 选择图片列表显示空白 HOT 7
- Android13适配怎么处理呢?求助 HOT 4
- 用Matisse进行拍照,有的手机获取不到图片的经纬度
- I want to Select all or deselect all pics from album, how is it possible?
- 图片选择相册页排序有些问题,对于app调用ContentResolver保存的新图片都显示在了最后
- java.lang.NullPointerException 拍照后奔溃,Android12 HOT 3
- 推荐另一个图片选择框架,已适配到 Android 13
- Release Build Failed
- 是否有单独视频预览的接口?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matisse.