Open Abdelsattar opened 7 years ago
@Abdelsattar Thanks for reporting this. Can you reproduce this crash and how?
`@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN) @AfterPermissionGranted(RC_CAMERA_PERM) void pickUpImage() { if (EasyPermissions.hasPermissions(this, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { // Have permission, do the thing! Matisse.from(MainActivity.this) .choose(MimeType.allOf()) .countable(true) .maxSelectable(9) .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) .thumbnailScale(0.85f) .imageEngine(new GlideEngine()) .forResult(REQUEST_CODE_CHOOSE);
} else {
Log.d("Matisse", "Dont have permsion");
// Ask for one permission
EasyPermissions.requestPermissions(this, getString(R.string.rationale_camera),
RC_CAMERA_PERM, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
}`
i used it with another activity of permission but after permission granted and the matisse open it crashed
Facing the same issue. Any update on this?
java.lang.NullPointerException: Attempt to invoke interface method 'void com.zhihu.matisse.engine.ImageEngine.loadThumbnail(android.content.Context, int, android.graphics.drawable.Drawable, android.widget.ImageView, android.net.Uri)' on a null object reference at com.zhihu.matisse.internal.ui.widget.PhotoGrid.setImage(PhotoGrid.java:112) at com.zhihu.matisse.internal.ui.widget.PhotoGrid.bindPhoto(PhotoGrid.java:80) at com.zhihu.matisse.internal.ui.adapter.AlbumPhotosAdapter.onBindViewHolder(AlbumPhotosAdapter.java:111) at com.zhihu.matisse.internal.ui.adapter.RecyclerViewCursorAdapter.onBindViewHolder(RecyclerViewCursorAdapter.java:44)
I can't reproduce this crash. @darshandawaibox can you provide more information?
@gejiaheng I fixed my way around that but now I am not getting the camera option/button as shown in the below screenshot. Also the preview is not working and is there any way I can customise the toolbar?
@darshandawaibox Let's get this clear:
Matisse.from(MainActivity.this)
....
.capture(true)
.captureStrategy(new CaptureStrategy(true, "com.zhihu.matisse.sample.fileprovider")
.forResult(REQUEST_CODE);
And also define a FileProvider
and /xml/file_paths_public.xml
like the sample does.
Matisse.from(MainActivity.this) .choose(MimeType.allOf()) .countable(true) .maxSelectable(9) .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) // .thumbnailScale(0.85f) // .imageEngine(new GlideEngine()) .forResult(REQUEST_CODE_CHOOSE);