Пример #1
0
 public void saveFile() {
   // TODO: Can the user save attachments on the internal filesystem or sd card only?
   if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
     /*
      * Abort early if there's no place to save the attachment. We don't want to spend
      * the time downloading it and then abort.
      */
     Toast.makeText(
             mContext,
             mContext.getString(R.string.message_view_status_attachment_not_saved),
             Toast.LENGTH_SHORT)
         .show();
     return;
   }
   if (mMessage != null) {
     mController.loadAttachment(mAccount, mMessage, part, new Object[] {true, this}, mListener);
   }
 }
Пример #2
0
 private void onViewButtonClicked() {
   if (mMessage != null) {
     mController.loadAttachment(mAccount, mMessage, part, new Object[] {false, this}, mListener);
   }
 }