I am setting an image to ImageView in android code not in xml, but could not make out how to check whether that image has been set in or not in java.
Tried with
You can also do this when any drawable is in your imageview and after you are adding image from gallery or any where. Try This
(imgAdd.drawable.constantState == resources.getDrawable(R.drawable.user_new).constantState) -> {
Snackbar.make(view, "Please Add Product Image",
Snackbar.LENGTH_SHORT).show()
}