obsolete-acexy / smartqq-agreement-core

🎉【Stopped】提供一个基于WebQQ协议的Java版SDK,使用它吧!打造AI聊天工具,报警系统,个人辅助……😘
https://www.thankjava.com/opensource/069239e5eee95a2299b804d9f98f1f9a
Apache License 2.0
59 stars 13 forks source link

安卓封装问题 #6

Closed f1owkang closed 7 years ago

f1owkang commented 7 years ago

ImageIO.write((BufferedImage)listenerAction.getData(), "png", new File("./log/qrcode.png")); 表示安卓我找不到imageio的jar包,所以有没有其他方法?下面我的方法报错 Byte[] b = (Byte[])listenerAction.getData(); Bitmap bit = BitmapFactory.decodeByteArray(b,0,b.length); File f = new File(PATH); Uri u1=Uri.fromFile(f); if (f.exists())f.delete(); try { FileOutputStream out=new FileOutputStream(f); bit.compress(Bitmap.CompressFormat.PNG, 90, out); context.sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", u1)); sengmsg(LOGIN_IMAGE, bit); } catch (FileNotFoundException e) { logger.debug("无法保存"); }