Solution to last challenge


#1

step 1; inflate a resource after u must have done this getSherlockActivity().setActionMode(Callback ) implement the callback by inflating a menu resource
//u can delete an existing file using :
public static boolean deleteRecentFile(Crime crime,Context context){
Photo photo=crime.getPhoto();
return context.deleteFile(photo.getFileName());
}

in your ActionItemClick callback do the following

if(PictureUtils.deleteRecentFile(mCrime, getSherlockActivity())){
Toast.makeText(getSherlockActivity(), “file deleted”, Toast.LENGTH_LONG).show();
PictureUtils.cleanUpImageDrawab(mPhotoView);
mCrime.setPhoto(null);
};
mode.finish();