@Override public void handleMessage(Message msg) { mSaveDialog.dismiss(); Log.d(TAG, mSaveMessage); ToastUtils.showShort(PictureActivity.this, mSaveMessage); if (mSaveMessage.equals("图片保存成功!")) { SnackbarUtil.show(container, "文件目录 : " + ALBUM_PATH, 10000); } }
@OnClick(R.id.header_appbar) void header_appbar_click() { if (kong == false) { Intent intent = new Intent(); intent.setClass(TodayActivity.this, VideoActivity.class); Bundle mBundle = new Bundle(); mBundle.putString("Url", mGankList.get(0).getUrl()); // 压入数据 mBundle.putString("Desc", mGankList.get(0).getDesc()); intent.putExtras(mBundle); startActivity(intent); } else { ToastUtils.showShort(TodayActivity.this, "没有数据,请选择别日或刷新"); } }
@Override public void onDateSet(DatePicker view, int yearOfToday, int monthOfYear, int dayOfMonth) { if (year == yearOfToday && month == monthOfYear + 1 && day == dayOfMonth) { System.out.println("时间选择没有改变"); } else { ToastUtils.showShort( TodayActivity.this, "您选择日期:" + yearOfToday + "/" + (monthOfYear + 1) + "/" + dayOfMonth); year = yearOfToday; month = monthOfYear + 1; day = dayOfMonth; todayToolbar.setTitle(year + "/" + month + "/" + day); mUrl = mUrlHead + year + "/" + month + "/" + day; getData(mUrl); } }
@Override public void run() { try { String filePath = url; mFileName = picId + ".jpg"; // ******** 直接从InputStream生成bitmap ***********/ mBitmap = BitmapFactory.decodeStream(getImageStream(filePath)); // ********************************************************************/ // 发送消息,通知handler在主线程中更新UI connectHanlder.sendEmptyMessage(0); Log.d(TAG, "set image ..."); } catch (Exception e) { ToastUtils.showShort(PictureActivity.this, "无法链接网络!"); e.printStackTrace(); } }