case R.id.lly_qrcode_scanner:// 二维码扫描
intent = new Intent(mContext, QRCodeScannerActivity.class);
startActivityForResult(intent, QRCODE_SCANNER_REQUEST);
openOrCloseDrawerLayout();
break;
报错信息:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ccdsbank.wallet, PID: 20661
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ccdsbank.wallet/com.ccdsbank.wallet.ui.activity.QRCodeScannerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void cn.bingoogolapple.qrcode.zxing.ZXingView.setDelegate(cn.bingoogolapple.qrcode.core.QRCodeView$Delegate)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3763)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3937)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2288)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8293)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void cn.bingoogolapple.qrcode.zxing.ZXingView.setDelegate(cn.bingoogolapple.qrcode.core.QRCodeView$Delegate)' on a null object reference
at com.ccdsbank.wallet.ui.activity.QRCodeScannerActivity.initDatas(QRCodeScannerActivity.java:72)
at com.ccdsbank.wallet.base.BaseActivity.onCreate(BaseActivity.java:78)
at android.app.Activity.performCreate(Activity.java:8241)
at android.app.Activity.performCreate(Activity.java:8207)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3736)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3937)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2288)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8293)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
这里调用扫码,就会报错
报错信息: