fishwjy / multitype-filepicker Goto Github PK
View Code? Open in Web Editor NEWThis is a light Android file picker library.
License: Apache License 2.0
This is a light Android file picker library.
License: Apache License 2.0
如题,有时手机拍出来照片太大了,可以考虑使用鲁班的。
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:604)
at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:578)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:416)
at com.vincent.filepicker.adapter.VideoPickAdapter$3.onClick(VideoPickAdapter.java:167)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6637)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
进入到图片选择界面之后 , 单击图片闪退
从fragment 中 打开图片选择列表页面,随机打开一张图片,点击 返回 (物理键 或者回退箭头),app 100% 崩溃
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:411)
at com.lzy.imagepicker.ImageDataSource.onLoadFinished(ImageDataSource.java:130)
at com.lzy.imagepicker.ImageDataSource.onLoadFinished(ImageDataSource.java:27)
I'm using this library to picking file image with this config
Intent intent = new Intent(getActivity(), ImagePickActivity.class); intent.putExtra(IS_NEED_CAMERA, true); intent.putExtra(Constant.MAX_NUMBER, 1); startActivityForResult(intent, Constant.REQUEST_CODE_PICK_IMAGE);
I place it into register screen & add new photo. register & add new photo placed in different activity, the first time I debug & set picker file image the request code is 256
. After I create the request again with same code I got different value of REQUEST_CODE_PICK_IMAGE
. It produce 65635
not 256
anymore. I've been override the Contant request code with startActivityForResult(intent, 99);
but I still got 65635
. How can I solve this?
引入项目时报错:Error:(49, 13) Failed to resolve: com.vincent.filepicker:MultiTypeFilePicker:latestVersion
Hi,
Thanks for plugin. It works fine. If I am viewing "ALL" folder and preview (enlarge) image it is correct, but as soon as I choose "Camera" or any other folder and preview (enlarge) image, the it shows wrong image. It seems that image order remains from "ALL" folder.
Thanks.
android.database.StaleDataException: Attempted to access a cursor after it has been closed.
at android.database.BulkCursorToCursorAdaptor.throwIfCursorIsClosed(BulkCursorToCursorAdaptor.java:64)
at android.database.BulkCursorToCursorAdaptor.getCount(BulkCursorToCursorAdaptor.java:70)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:197)
at android.database.AbstractCursor.moveToNext(AbstractCursor.java:245)
at android.database.CursorWrapper.moveToNext(CursorWrapper.java:166)
at com.vincent.filepicker.filter.callback.FileLoaderCallbacks$1.run(FileLoaderCallbacks.java:189)
at java.lang.Thread.run(Thread.java:841)
报这种错,直接页面闪退
When using on Samsung Note 9 Android P it crashes.
No virtual method centerCrop()Lcom/bumptech/glide/request/RequestOptions; in class Lcom/bumptech/glide/request/RequestOptions; or its super classes (declaration of 'com.bumptech.glide.request.RequestOptions' appears in /data/app/com.knaufsales-2opAlA_ZOcFgKXlvtj-Rmg==/base.apk)
java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=5544, uid=10363 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
How can i take image from camera directly instead of opening camera from gallery screen?
If you select video or audio file from SD card to play that time you will get hard crash like this:
An uncaught Exception occurred on "main" thread.
java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/6362-**/***.mp4
at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:719)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:404)
at com.vincent.filepicker.adapter.VideoPickAdapter$3.onClick(VideoPickAdapter.java:174)
at android.view.View.performClick(View.java:6897)
at android.view.View$PerformClick.run(View.java:26101)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Fixed here: #41
在选择文件时会出现ANR,希望能解决
+--- com.vincent.filepicker:MultiTypeFilePicker:1.0.5
| +--- com.android.support:appcompat-v7:25.3.1 -> 26.1.0 ()
| +--- com.android.support:recyclerview-v7:25.3.1 -> 26.1.0 ()
| +--- com.github.bumptech.glide:glide:3.7.0 -> 4.3.1
| | +--- com.github.bumptech.glide:gifdecoder:4.3.1
| | | --- com.android.support:support-annotations:26.0.2 -> 26.1.0
| | +--- com.github.bumptech.glide:disklrucache:4.3.1
| | --- com.github.bumptech.glide:annotations:4.3.1
i have exclude glide from dependency, not working. can you help me out ?
如题
华为手机,android 6.0.1 选择视频模式进入后直接crash了。
调用方式
Intent intent = new Intent(getActivity(), VideoPickActivity.class); intent.putExtra(VideoPickActivity.IS_NEED_CAMERA, true); intent.putExtra(Constant.MAX_NUMBER, 1); startActivityForResult(intent, Constant.REQUEST_CODE_PICK_VIDEO);
java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA at android.media.MediaMetadataRetriever.setDataSource(Native Method) at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:71) at com.vincent.filepicker.filter.callback.FileLoaderCallbacks.getVideoThumb(FileLoaderCallbacks.java:371) at com.vincent.filepicker.filter.callback.FileLoaderCallbacks.access$200(FileLoaderCallbacks.java:57) at com.vincent.filepicker.filter.callback.FileLoaderCallbacks$1.run(FileLoaderCallbacks.java:237) at java.lang.Thread.run(Thread.java:833)
When I try to select camera option to take picture, the app is crashing, on devices running Oreo & up, due to WRITE_EXTERNAL_STORAGE
permission denial. Below is the error trace:
FATAL EXCEPTION: main
Process: com.maesupport, PID: 30269
java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=30269, uid=10359 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.createException(Parcel.java:1966)
at android.os.Parcel.readException(Parcel.java:1934)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
at android.content.ContentResolver.insert(ContentResolver.java:1594)
at com.vincent.filepicker.adapter.ImagePickAdapter$1.onClick(ImagePickAdapter.java:93)
at android.view.View.performClick(View.java:7339)
at android.view.View.performClickInternal(View.java:7305)
at android.view.View.access$3200(View.java:846)
at android.view.View$PerformClick.run(View.java:27788)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7076)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
com.vincent.filepickersample E/AndroidRuntime: FATAL EXCEPTION: ModernAsyncTask #1
Process: com.vincent.filepickersample, PID: 13011
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.support.v4.content.ModernAsyncTask$3.done(ModernAsyncTask.java:153)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=13011, uid=10237 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1683)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:530)
at android.support.v4.content.ContentResolverCompatJellybean.query(ContentResolverCompatJellybean.java:29)
at android.support.v4.content.ContentResolverCompat$ContentResolverCompatImplJB.query(ContentResolverCompat.java:57)
at android.support.v4.content.ContentResolverCompat.query(ContentResolverCompat.java:125)
at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:59)
at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:37)
at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:296)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:54)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:42)
at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:133)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Throw android.os.FileUriExposedException on Android N when use Camera
rt
在一些手机,使用
Intent intent4 = new Intent(this, NormalFilePickActivity.class);
intent4.putExtra(Constant.MAX_NUMBER, 9);
intent4.putExtra(NormalFilePickActivity.SUFFIX, new String[] {"xlsx", "xls", "doc", "docx", "ppt", "pptx", "pdf"});
startActivityForResult(intent4, Constant.REQUEST_CODE_PICK_FILE);
没有得到任何文件的,显示为空。
When choose use camera and take photo, it is showing 2 selected images.
After, If I open an image preview and then close it, It will add +1.
It will keep adding +1 even if I don't check the image preview.
Clicking in DONE btn send me back to previous activity with N times the camera image.
类似微信、知乎可以按照文件夹分类
Hi there,
I really like this library, good work!
I've some questions / improvements that could make this library even better:
Thanks in advance!
Newly downloaded files do not visible but after renaming or copy/paste becoming visible. Is it possible to fix it? Your work is beautiful, thanks.
in RTL layouts it shows messed up!
thanks for good library
please fix it!
目前在项目中升级到glide4.0,需要做相应适配
Process: com.skoolsync.app, PID: 31730
java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/999/WhatsApp/Media/WhatsApp Video/VID-20190531-WA0002.mp4
at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:738)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:417)
at com.vincent.filepicker.adapter.VideoPickAdapter$3.onClick(VideoPickAdapter.java:167)
at android.view.View.performClick(View.java:6390)
at android.view.View$PerformClick.run(View.java:25270)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:187)
at android.app.ActivityThread.main(ActivityThread.java:7025)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:514)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)
Hello fishwjy, i want to know how to add custom theme for the this library? thank you in advance
How to restrict number of file selection
文件选择能够定义只选择一种格式吗?例如只识别并扫描本地的Excel。
Crashed on Android 8.0
Fatal Exception: android.os.FileUriExposedException: file:///storage/emulated/0/WhatsApp/Media/WhatsApp Video/VID-20180518-WA0006.mp4 exposed beyond app through Intent.getData()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958)
at android.net.Uri.checkFileUriExposed(Uri.java:2356)
at android.content.Intent.prepareToLeaveProcess(Intent.java:10511)
at android.content.Intent.prepareToLeaveProcess(Intent.java:10465)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1616)
at android.app.Activity.startActivityForResult(Activity.java:4564)
at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:67)
at android.app.Activity.startActivityForResult(Activity.java:4522)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:732)
at android.app.Activity.startActivity(Activity.java:4883)
at android.app.Activity.startActivity(Activity.java:4851)
at com.vincent.filepicker.adapter.VideoPickAdapter$3.onClick(VideoPickAdapter.java:164)
at android.view.View.performClick(View.java:6891)
at android.view.View$PerformClick.run(View.java:26083)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Can anyone please help me to fix this ?
点击拍照时如果取消了拍照,会出现一张空白的图片
需要在ImagePickActivity的onActivityResult中判断resultCode != RESULT_OK时删除掉这张图片
`case Constant.REQUEST_CODE_TAKE_IMAGE:
if (resultCode == RESULT_OK) {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
File file = new File(mAdapter.mImagePath);
Uri contentUri = Uri.fromFile(file);
mediaScanIntent.setData(contentUri);
sendBroadcast(mediaScanIntent);
loadData();
}else {
//删除添加的file ,mAdapter.mUri 是将Adapter中创建的图片Uri提到全局并public
getApplicationContext().getContentResolver().delete(mAdapter.mUri, null, null);
}`
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1862) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1582) at android.app.Activity.startActivityForResult(Activity.java:3830) at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79) at android.app.Activity.startActivityForResult(Activity.java:3787) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859) at com.vincent.filepicker.activity.AudioPickActivity.onOptionsItemSelected(AudioPickActivity.java:146) at android.app.Activity.onMenuItemSelected(Activity.java:2966) at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:408) at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195) at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:113) at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:113) at android.support.v7.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:69) at android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:206) at android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:776) at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:822) at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:156) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:969) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:959) at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:623) at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:154) at android.view.View.performClick(View.java:4900) at android.view.View$PerformClick.run(View.java:20381) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5877) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
当你点击大图下边的选择按钮,然后按确定返回,返回到主界面的时候没有携带图片的信息。
错误: 无法访问EasyPermissions
找不到pub.devrel.easypermissions.EasyPermissions的类文件
androidstudio:3.2.1
compileSDK: api27
miniSDK: api23
TargetSDK: api27
built tool version: 27.0.3
Dear Mr,
Thank you for your library. But i found some bug in your library.
(My phone API level 25)
Firstly, if I choose nothing => tap DONE button => bug
Secondly, VideoPickActivity.class ONLY load video that I have just captured by Camera of my phone.
Thirdly, i met "java.lang.RuntimeException: Unable to resume" activity when I click "ok" in "IsNeedCamera" function.
When choosing videopicker and use camera to choose video,when choose "right" check causing crash problem,hope to get the solution soon
I dont want Google to auto back up my app's data so i set
android:allowBackup="false" android:fullBackupContent="false"
in manifests. But after adding this library, I'm getting this error:
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:11:9-36
is also present at [com.vincent.filepicker:MultiTypeFilePicker:1.0.8] AndroidManifest.xml:15:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:10:5-45:19 to override.
For that i have to set tools:replace="android:allowBackup"
which it turns to allow backups..
Please help me to solve this.
I get this error when I try to open Imagepicker
Deleted file also showing in the pdf selector
i am using xiaomi redmi note 3 pro and just for test i deleted the pdf file and again tried, but the deleted file also getting displayed , i think main reason for this is xiaomi phones deleted file are stored in cache or hidden is there any way to fix this, because i literally checked the path by:
else if (requestCode == Constant.REQUEST_CODE_PICK_FILE && resultCode == RESULT_OK) {
mPdf = data.getParcelableArrayListExtra(Constant.RESULT_PICK_FILE);
if (mPdf.size() != 0) {
long sizOfFile = mPdf.get(0).getSize() / 1024;//get size of file
// 5120
if (sizOfFile < 50000 && sizOfFile > 50) {//MB check
mPath = mPdf.get(0).getPath();
mFileSize = mPdf.get(0).getSize();
showPreView(mPath);
dismissAlertDialed();
} else {
finish();
HelperMethods.showToastLong(mContext, "File size should be less then 50 MB and bigger then 5kb!");
}
} else {
finish();
HelperMethods.showToastLong(mContext, "Please select valid Pdf File!");
}
}
private void showPreView(String path) {
if (HelperMethods.isStringNotEmpty(path)) {
HelperMethods.showLogData("Path: " + path);
File file = new File(mPath);
if (file.exists()) {
HelperMethods.showLogData("File exists");
} else {
HelperMethods.showLogData("File dose'nt exists");
}
} else {
HelperMethods.showLogData("Path is wrong!");
HelperMethods.showToastLong(mContext, "Selected file is not valid file!");
}
}
and its clearly showing log as "File dose'nt exists", please help
The selected picture has correct orientation on preview, however, the picture turns sideways when selection completed.
getting android.os.FileUriExposedException error, make it support after nougat
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.