⑤展示二维码
public static void showThreadImage(final Activity mContext, final String text, final ImageView imageView, final int centerPhoto) { String preContent = SPUtil.getString("share_code_content", ""); if (text.equals(preContent)) { String preFilePath = SPUtil.getString("share_code_filePath", ""); imageView.setImageBitmap(BitmapFactory.decodeFile(preFilePath)); } else { SPUtil.putString("share_code_content", text); final String filePath = getFileRoot(mContext) + File.separator + "qr_" + System.currentTimeMillis() + ".jpg"; SPUtil.putString("share_code_filePath", filePath); //二维码图片较大时,生成图片、保存文件的时间可能较长,因此放在新线程中 new Thread(new Runnable() { @Override public void run() { boolean success = QRCodeUtil.createQRImage(text, 800, 800, BitmapFactory.decodeResource(mContext.getResources(), centerPhoto), filePath); if (success) { mContext.runOnUiThread(