I have an ImageButton which on click i show a dialog box where users can either take a photo from the camera or choose from the gallery. On selecting image from either sources i setBitmap for that ImageButton to the image selected like this
SelectedPhoto = BitmapFactory.decodeFile(selectedImagePath);
DisplayPhoto.setImageBitmap(SelectedPhoto);
Now when some one has already selected an image and click the image again i want to show a different dialog which contains a third option "Remove Photo".
What property of the image button should i check and against what ?
ImageButton in XML
<ImageButton
android:id="@+id/DisplayPhoto"
android:layout_width="95dip"
android:layout_height="95dip"
android:layout_marginRight="8dip"
android:background="@drawable/signup_photo_selector" android:scaleType="centerCrop" />
ImageButton Background XML
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/signup_form_photo_selected" android:state_pressed="true"/>
<item android:drawable="@drawable/signup_form_photo"/>
</selector>