Comments (8)
有个办法可以解决下,在androidmanifast中加入这条语句 android:configChanges="screenSize|keyboardHidden|orientation"
但又出现另一个问题,解锁过快,扫描界面会崩掉。。。
from android-zxing.
扫描页面生命周期是否加入
@Override
protected void onResume() {
mScannerView.onResume();
resetStatusView();
super.onResume();
}
@Override
protected void onPause() {
mScannerView.onPause();
super.onPause();
}
from android-zxing.
贴一下崩溃log
from android-zxing.
只是扫描界面崩溃,这个日志有点看不懂
10-18 11:00:45.429 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: Late-enabling CheckJNI
10-18 11:00:45.539 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
10-18 11:00:45.539 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
10-18 11:00:45.539 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve interface method 17261: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve interface method 17265: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
10-18 11:00:45.559 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getTotalMemory ()J
10-18 11:00:45.559 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getFreeMemory ()J
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 475: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 497: Landroid/content/res/TypedArray;.getType (I)I
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 438: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 440: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.799 21546-21546/com.mylhyl.zxing.scanner.sample I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.2.2.2_RB1.04.04.04.154.004_msm8226_LNX.LA.3.5.2.2.2_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.24.00.15
Build Date: 08/06/14 Wed
Local Branch: mybranch4057433
Remote Branch: quic/LNX.LA.3.5.2.2.2_rb1
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.2.2.2_RB1.04.04.04.154.004 + NOTHING
10-18 11:00:45.839 21546-21546/com.mylhyl.zxing.scanner.sample D/OpenGLRenderer: Enabling debug mode 0
10-18 11:00:45.919 21546-21546/com.mylhyl.zxing.scanner.sample I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@423b84f0 time:718577
from android-zxing.
但是在zxing默认的app上面有这个错误日志
10-18 11:02:14.219 23878-24627/com.sunwayworld.zxing W/dalvikvm: threadid=18: thread exiting with uncaught exception (group=0x41769d58)
10-18 11:02:14.219 23878-24627/com.sunwayworld.zxing E/AndroidRuntime: FATAL EXCEPTION: Thread-430
Process: com.sunwayworld.zxing, PID: 23878
java.lang.IllegalArgumentException: Crop rectangle does not fit within image data.
at com.google.zxing.PlanarYUVLuminanceSource.(PlanarYUVLuminanceSource.java:50)
at com.sunwayworld.zxing.camera.CameraManager.buildLuminanceSource(CameraManager.java:346)
at com.sunwayworld.zxing.decoding.DecodeHandler.decode(DecodeHandler.java:97)
at com.sunwayworld.zxing.decoding.DecodeHandler.handleMessage(DecodeHandler.java:64)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.sunwayworld.zxing.decoding.DecodeThread.run(DecodeThread.java:123)
10-18 11:02:14.239 23878-24627/com.sunwayworld.zxing I/Process: Sending signal. PID: 23878 SIG: 9
from android-zxing.
sample没有异常,请贴出崩溃后的异常log
from android-zxing.
(横屏下)这个在我的红米手机 解锁过快的情况的才会出现(电源键锁屏后立即解锁)
from android-zxing.
找到了,这错误被覆盖了:
0-18 11:35:32.009 2312-2685/? I/octvm_klo: klo lock
10-18 11:35:32.009 26588-26846/com.mylhyl.zxing.scanner.sample E/AndroidRuntime: FATAL EXCEPTION: Thread-502
Process: com.mylhyl.zxing.scanner.sample, PID: 26588
java.lang.IllegalArgumentException: Crop rectangle does not fit within image data.
at com.google.zxing.PlanarYUVLuminanceSource.(PlanarYUVLuminanceSource.java:50)
at com.mylhyl.zxing.scanner.camera.CameraManager.buildLuminanceSource(CameraManager.java:365)
at com.mylhyl.zxing.scanner.decode.DecodeHandler.decode(DecodeHandler.java:93)
at com.mylhyl.zxing.scanner.decode.DecodeHandler.handleMessage(DecodeHandler.java:60)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.mylhyl.zxing.scanner.decode.DecodeThread.run(DecodeThread.java:134)
10-18 11:35:32.009 1168-1616/? W/ActivityManager: Force finishing activity com.mylhyl.zxing.scanner.sample/.ScannerActivity
from android-zxing.
Related Issues (20)
- camera 有开放出来么 怎么获取到
- 扫描界面锁屏后再打开黑屏 HOT 6
- can't find referenced method 'int save(int)' in library class android.graphics.Canvas HOT 3
- 图片导入扫码 HOT 1
- 能不能支持自动检测,提示开启闪光灯? HOT 1
- app编译版本28,模块无法正常运行 HOT 2
- java.lang.IllegalArgumentException:Crop rectangle does not fit within image data.
- java.lang.ArrayIndexOutOfBoundsException
- 下载android studio3.4.1之后,com.google.zxing.Result 找不到, HOT 3
- Android5.1创建二维码报UnsupportedEncodingException: java.nio.charset.CharsetICU[UTF-8] HOT 1
- 报错java.lang.UnsupportedOperationException: Binary XML file line #-1: You must supply a layout_width attribute.
- 如何释放scannerview,就是我感觉在一个界面使用scannerview后面隐藏显示我请求的数据,这个页面就会有点卡顿
- 在扫描界面,切换到系统设置关闭相机权限,再切换回扫描界面,app就挂了。
- 横屏、竖屏一切换就崩溃 HOT 1
- 无法扫描反色二维码 HOT 4
- ...
- 扫码页面高度不是全屏的时候在红米手机上会出现预览界面压缩 很难识别
- 前置摄像头扫条形码怎么识别 HOT 1
- jcenter停止维护,近期有迁移计划吗? HOT 3
- 如何自定义选择摄像头扫描,不想默认摄像头我想自己选择哪个摄像头进行扫描如何实现。请回答一下谢谢
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 android-zxing.