Comments (2)
这个库只有图片选择的功能。没有图片上传的功能。哪来的取消上传的动作。
from imageselector.
这个问题已经解决了,是我没描述对.
这边功能是这样的.
安卓webview加载页面,然后页面中有上传文件的操作.上传的时候打开图片库进行选择.我用到了这个库.使用中发现当关闭选择图片后web页面没有重置上传的组件.导致没法再次点击上传.
具体处理是在onActivityResult中处理的.一般选择文件后会有一个这样的判断
if (requestCode == REQUEST_CODE_CHOOSE && resultCode == RESULT_OK)
然后在判断为true的时候处理文件选择后的逻辑,这里再加上为false逻辑处理就行了
代码大概是这样的
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_CHOOSE && resultCode == RESULT_OK) {
//进行相关逻辑处理
}else{
uploadMessageAboveL.onReceiveValue(null);//这行代表没有选择文件,这样web页面的上传组件就可以自己重置状态了
}
uploadMessageAboveL = null;
}
from imageselector.
Related Issues (20)
- 视频选择建议 HOT 1
- 有考虑加上视屏文件的选取预览功能吗
- 希望尽快适配下 Android 11
- 不能取消预览 HOT 2
- 点击列表预览图片,删除列表中图片如何实现呢 HOT 4
- 9.0拍照时报空指针
- android11 miui12.1.1稳定版 拍照崩溃 参数传递异常 HOT 3
- java.lang.IllegalArgumentException: Invalid token limit HOT 10
- Attempt to read from field 'int com.donkingliang.imageselector.entry.RequestConfig.f' on a null object reference HOT 1
- 点击预览空指针 HOT 2
- 大图OOM HOT 1
- Android 10以上拍照会崩溃
- vivo X20Plus A 等部分机型,保存图片到相册后,选择器不显示该图片
- ImageSelectorActivity空指针崩溃
- 华为手机鸿蒙3.0系统点击拍照,直接白屏,日志没有报错信息 HOT 2
- Android 9 targetSdkVersion = 32拍照不能返回图片,必须杀死应用后重启,才可以?
- 权限获取问题 HOT 6
- bug
- 适配android11存储权限
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 imageselector.