Giter Club home page Giter Club logo

Comments (2)

donkingliang avatar donkingliang commented on August 12, 2024

这个库只有图片选择的功能。没有图片上传的功能。哪来的取消上传的动作。

from imageselector.

ling976 avatar ling976 commented on August 12, 2024

这个问题已经解决了,是我没描述对.
这边功能是这样的.
安卓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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.