public void saveImage() {
   if (mImageShow.hasModifications()) {
     // Get the name of the album, to which the image will be saved
     File saveDir = SaveCopyTask.getFinalSaveDirectory(this, mImageLoader.getUri());
     int bucketId = GalleryUtils.getBucketId(saveDir.getPath());
     String albumName = LocalAlbum.getLocalizedName(getResources(), bucketId, null);
     showSavingProgress(albumName);
     mImageShow.saveImage(this, null);
   } else {
     finish();
   }
 }
  @Override
  public boolean onShareTargetSelected(ShareActionProvider arg0, Intent arg1) {
    // First, let's tell the SharedImageProvider that it will need to wait
    // for the image
    Uri uri =
        Uri.withAppendedPath(
            SharedImageProvider.CONTENT_URI, Uri.encode(mSharedOutputFile.getAbsolutePath()));
    ContentValues values = new ContentValues();
    values.put(SharedImageProvider.PREPARE, true);
    getContentResolver().insert(uri, values);
    mSharingImage = true;

    // Process and save the image in the background.
    showSavingProgress(null);
    mImageShow.saveImage(this, mSharedOutputFile);
    return true;
  }