刚开始保存图片到本地更新相册后时间显示1970年月1日,网上看了好多方案都不用
详细代码:
/** * 将URL转化成bitmap形式 * * @param url * @return bitmap type */ public final static Bitmap returnBitMap(String url) { URL myFileUrl; Bitmap bitmap = null; try { myFileUrl = new URL(url); HttpURLConnection conn; conn = (HttpURLConnection) myFileUrl.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); bitmap = BitmapFactory.decodeStream(is); } catch (MalformedURLException e) { e.printStackTrace(); <