@Override
 public void onChooseAvatarPhoto() {
   Intent intentPicture = new Intent(Intent.ACTION_PICK, null);
   intentPicture.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, IMAGE_UNSPECIFIED);
   if (getActivity() != null) {
     startActivityForResult(intentPicture, TYPE_CHOOSE_PHOTO);
   }
   PlannerEvent.getAvatarAction(CHOOSE_PHOTO_ACTION).track();
 }
  @Override
  public void onDeleteAvatarPhoto() {
    ImageLoader.getInstance()
        .displayImage(
            String.format("drawable://%s", R.drawable.dashboard_backgroud_picture),
            mIvAvatar,
            PlannerApplication.getDefaultDisplayImageOptions(
                R.drawable.dashboard_backgroud_picture),
            null);
    final Activity activity = getActivity();
    if (activity != null && activity instanceof MainActivity) {
      initLoader(
          CouplePhotoProvider.removeCouplePhotoProvider(
              PlannerApplication.getUserProfile().getCouplePhotoId(),
              UserAccountFragment.this,
              null));
      UserProfile userProfile = PlannerApplication.getUserProfile();
      userProfile.setCouplePhotoId(UserProfile.COUPLE_ID);
      new UserProfileProvider()
          .updateAccount(
              userProfile,
              mWeddingLocationMarketCode,
              mHomeMarketCode,
              new OnProviderDataCallBackListener<UserProfile>() {
                @Override
                protected Activity getActivity() {
                  return UserAccountFragment.this.getActivity();
                }
              },
              UserAccountFragment.this,
              activity);
      UserProfile.updateUserCouplePhoto(PlannerApplication.getUserProfile().getCouplePhotoUrl());

      SyncedObject.DashboardPhotoChangedSyncedObject dashboardPhotoChangedSyncedObject =
          new SyncedObject.DashboardPhotoChangedSyncedObject();
      dashboardPhotoChangedSyncedObject.setUrl(null);
      syncedRefreshDataListener(dashboardPhotoChangedSyncedObject);

      if (!PlannerApplication.isEmptyOrNull(mStatus)
          && mStatus.equals(PlannerApplication.PREF_DASHBOARD_FLAG)) {
        activity.onBackPressed();
      }
    }

    PlannerEvent.getAvatarAction(DELETE_PHOTO_ACTION).track();
  }
 @Override
 public void onTakeAvatarPhoto() {
   mImageName = String.format("%s%s", System.currentTimeMillis(), ".jpg");
   File dir =
       new File(
           String.format(
               "%s%s",
               Environment.getExternalStorageDirectory().getAbsolutePath(),
               getString(R.string.account_image_file_name)));
   if (!dir.exists()) {
     dir.mkdir();
   }
   Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
   intent.putExtra(
       MediaStore.EXTRA_OUTPUT,
       Uri.fromFile(new File(dir.getAbsoluteFile().toString(), mImageName)));
   if (getActivity() != null) {
     startActivityForResult(intent, TYPE_TAKE_PHOTO);
   }
   PlannerEvent.getAvatarAction(TAKE_PHOTO_ACTION).track();
 }