Skip to content
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

Open
zouxianbincc opened this issue Oct 17, 2017 · 15 comments
Open

使用了过时的API #3

zouxianbincc opened this issue Oct 17, 2017 · 15 comments

Comments

@zouxianbincc
Copy link

/**
* 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

@zybieku
Copy link
Owner

zybieku commented Oct 17, 2017

是的,过时还能用,能21开始整个 Camera类都被已经过时,google建议用Camera2,大佬你可以自己修改成Camera2的Api

@liaomabao
Copy link

大佬,按返回键就退出,程序崩了。怎么回事 呢?
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference

@zybieku
Copy link
Owner

zybieku commented Nov 15, 2017

@liaomabao 你用的是新版么,这个空指针的原因是返回的时候,二维码数据为空,再mainActivity里面的回调里面做一下空指针判断就行啦.

@zybieku
Copy link
Owner

zybieku commented Nov 15, 2017

@liaomabao 我刚才改了,你重新下载运行下demo,看还有问题麽

@liaomabao
Copy link

是的,这样就行了:if (requestCode == QR_CODE && data != null) {

@zybieku
Copy link
Owner

zybieku commented Nov 15, 2017

@liaomabao 嗯啦.大佬 您还有问题麽!

@liaomabao
Copy link

@zybieku 挺好的,简单易用,谢谢大兄弟,这块没有问题了。but,最好是把二维码生成也一起封装了呗,这两玩意儿是一对,嘿嘿。

@chenfeizi
Copy link

你好,怎么才能扫完一次之后再重复扫码?

@zybieku
Copy link
Owner

zybieku commented Mar 27, 2018

@chenfeizi 可以呀 ,1:你打开重新扫码,二是:修改源码,让他扫码成功后也不关闭,如下图
image

@chenfeizi
Copy link

[
还是只能扫码一次,我在这

checkResult(final String result) 方法里面

得到扫码结果之后就不能再次扫码了,必须得关闭这页面重新进来才能在扫一次,有没有什么方法可以立即重新扫码?]

@zybieku
Copy link
Owner

zybieku commented Mar 27, 2018

可以呀,不过要改handler 解码部分的源码了,因为现在做的是解码成功就handler关闭消息发送

@chenfeizi
Copy link

不会改呀,楼主什么时候有时间能不能优化下,非常感谢!

@chenfeizi
Copy link

大哥,急救,用你的扫码怎么打开闪光灯?

@zybieku
Copy link
Owner

zybieku commented Mar 27, 2018

@chenfeizi 周末才有时间弄啊,这周末好么

@fhdis
Copy link

fhdis commented Sep 10, 2018

大神,运行报错so库找不到。
在网上找到相关的so库替换,直接报错。
能否提供较全的so库?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants