Comments (2)
mAgentWeb = AgentWeb.with(this)
.setAgentWebParent()
.useDefaultIndicator()
.setAgentWebUIController(new AgentWebUIControllerImplBase(){
@Override
public void onSelectItemsPrompt(WebView view, String url, String[] ways, Handler.Callback callback) {
// 拦截拍照和选择文件,自定义代码可参考 super.onSelectItemsPrompt
}
})
.createAgentWeb()
.go(getUrl());
from agentweb.
.setAgentWebUIController(object : AgentWebUIControllerImplBase() {
override fun onSelectItemsPrompt(view: WebView, url: String, ways: Array, callback: Handler.Callback) {
// 拦截拍照和选择文件,只需要拍照
if (callback != null) {
val mMessage = Message.obtain()
mMessage.what = 0 //mMessage.what 必须等于ways的index
callback.handleMessage(mMessage) //最后callback一定要回调
}
}
})
只让用户跳转相册,但是还是会弹出读取文件的权限怎么解决?
from agentweb.
Related Issues (20)
- 有没有好心人适配下android13 无法选择图片 和调起摄像头 HOT 10
- 你好。我用谷歌浏览器APK加载一个本地网页是正常的。但是用我创建的agentweb就不行,报错如下请问有什么解决方案吗。
- 2023年了这个库还有维护吗
- 安卓14中无法点击相机和相册没反应
- android13 重定向 goback失效 HOT 5
- 网页中的竖屏视频点击全屏按钮无法进入横屏并全屏
- 无法处理input标签里面的 accept=".png,.jpg,.jepg" HOT 2
- 老哥,从5.0.6升级到5.1.1,咋全都爆红了😂 HOT 1
- 默认支持Chrome://inspect 调试吗 HOT 1
- 关于H5页面请求过多,导致Webviiew打不开的问题 HOT 2
- 腾讯意愿核身
- 市场隐私合格审核报获取特殊传感器问题 日志如下 HOT 3
- webview内容的字体 如何跟随系统字体?
- com.just.agentweb.AgentActionFragment.onRequestPermissionsResult java.lang.NullPointerException
- 重写onJsAlert问题
- 请问怎么集成到compose中使用 HOT 2
- 友盟上统计了个崩溃
- net::ERR_INSUFFICIENT RESOURCES
- 在fragment中使用AgentWeb后,在当前页面打开一个使用原生Webview的Activity,页面出现白屏 HOT 2
- 下载最新demo 运行在安卓10版本的手机上,上传文件PermissionInterceptor拦截不到权限 HOT 1
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 agentweb.