-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用了过时的API #3
Comments
是的,过时还能用,能21开始整个 Camera类都被已经过时,google建议用Camera2,大佬你可以自己修改成Camera2的Api |
大佬,按返回键就退出,程序崩了。怎么回事 呢? |
@liaomabao 你用的是新版么,这个空指针的原因是返回的时候,二维码数据为空,再mainActivity里面的回调里面做一下空指针判断就行啦. |
@liaomabao 我刚才改了,你重新下载运行下demo,看还有问题麽 |
是的,这样就行了:if (requestCode == QR_CODE && data != null) { |
@liaomabao 嗯啦.大佬 您还有问题麽! |
@zybieku 挺好的,简单易用,谢谢大兄弟,这块没有问题了。but,最好是把二维码生成也一起封装了呗,这两玩意儿是一对,嘿嘿。 |
你好,怎么才能扫完一次之后再重复扫码? |
@chenfeizi 可以呀 ,1:你打开重新扫码,二是:修改源码,让他扫码成功后也不关闭,如下图 |
[ checkResult(final String result) 方法里面 得到扫码结果之后就不能再次扫码了,必须得关闭这页面重新进来才能在扫一次,有没有什么方法可以立即重新扫码?] |
可以呀,不过要改handler 解码部分的源码了,因为现在做的是解码成功就handler关闭消息发送 |
不会改呀,楼主什么时候有时间能不能优化下,非常感谢! |
大哥,急救,用你的扫码怎么打开闪光灯? |
@chenfeizi 周末才有时间弄啊,这周末好么 |
大神,运行报错so库找不到。 |
/**
* Callback interface used to deliver copies of preview frames as
* they are displayed.
*
* @see #setPreviewCallback(Camera.PreviewCallback)
* @see #setOneShotPreviewCallback(Camera.PreviewCallback)
* @see #setPreviewCallbackWithBuffer(Camera.PreviewCallback)
* @see #startPreview()
*
* @deprecated We recommend using the new {@link android.hardware.camera2} API for new
* applications.
*/
Camera.PreviewCallback
/**
* Callback interface used to notify on completion of camera auto focus.
*
*
Devices that do not support auto-focus will receive a "fake"
* callback to this interface. If your application needs auto-focus and
* should not be installed on devices without auto-focus, you must
* declare that your app uses the
* {@code android.hardware.camera.autofocus} feature, in the
* <uses-feature>
* manifest element.
*
* @see #autoFocus(AutoFocusCallback)
* @deprecated We recommend using the new {@link android.hardware.camera2} API for new
* applications.
*/
AutoFocusCallback
The text was updated successfully, but these errors were encountered: