@Override public void onClick(View v) { switch (v.getId()) { case R.id.app_update_all_btn: // 全部升级 if (mBean.uAppList != null) { for (UpdateAppBean bean : mBean.uAppList) { // 判读是否已安装已下载 if (FileUtil.isFileExist(DownloadUtil.getCApkFileFromUrl(bean.downloadUrl))) { continue; } if (bean.downloadStatus != DownloadTask.DOWNLOADING || bean.downloadStatus != DownloadTask.WAITING) { bean.downloadStatus = DownloadTask.WAITING; Intent intent = new Intent(IDownloadInterface.DOWNLOAD_REQUEST_ACTION); intent.putExtra("command", IDownloadInterface.REQUEST_COMMAND_ADD); intent.putExtra("url", bean.downloadUrl); intent.putExtra("iconUrl", bean.iconUrl); intent.putExtra("name", bean.name); intent.putExtra("size", bean.size); intent.putExtra("packName", bean.packageName); intent.putExtra("appId", bean.id + 0l); intent.putExtra("version", bean.version); intent.putExtra("page", "应用更新"); TAApplication.getApplication().sendBroadcast(intent); } } adapter.notifyDataSetChanged(); } break; default: break; } }
/** * 獲取本地圖片 * * @param iamgeName * @return */ public static Bitmap getSDBitmap(String iamgeName) { File imageFile = new File(FileUtil.getImagePath(), iamgeName); Bitmap bitmap = null; if (imageFile.exists()) { try { bitmap = BitmapFactory.decodeStream(new FileInputStream(imageFile)); if (bitmap != null) { // Log.d(TAG, "imagepATH:找到了"); } } catch (FileNotFoundException e) { e.printStackTrace(); } } return bitmap; }