简体   繁体   English

如何修复无法解析符号'WriterException'

[英]How to fix cannot resolve symbol 'WriterException'

I am new in android development and, I am following a QR code generator application tutorial using java, the developer in that tutorial throws a WriterException, while I am trying to do the same I face this error (cannot resolve symbol 'WriterException' ).我是 android 开发的新手,我正在关注使用 java 的 QR 码生成器应用程序教程,该教程中的开发人员抛出了 WriterException,而我尝试做同样的事情时遇到了这个错误(无法解析符号 'WriterException' )。 I'm using this library https://github.com/androidmads/QRGenerator我正在使用这个库https://github.com/androidmads/QRGenerator

    genebtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            String data = qrvalue.getText().toString();
            QRGEncoder qrgEncoder= new QRGEncoder(data,null, QRGContents.Type.TEXT,500);
            try {
                // Getting QR-Code as Bitmap
               Bitmap bitmap = qrgEncoder.getBitmap();
                // Setting Bitmap to ImageView
                qrimage.setImageBitmap(bitmap);
            } catch (WriterException e) {
                e.printStackTrace();

Set your mouse cursor on this error and click alt+enter to import class.This error existed because maybe import havn't been declared将此错误设置为鼠标 cursor 并单击 alt+enter 以导入 class。存在此错误是因为可能尚未声明导入

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM