Issue
if (image.getDrawable().getConstantState().equals(getResources().getDrawable(0).getConstantState())){
image.setVisibility(View.GONE);
}else{
image.setVisibility(View.VISIBLE);
}
That is, if image has not any drawable, image will be GONE, else Visible. But this code does not work
Solution
You can call the getDrawable function on the image view and check if it is not null - https://stackoverflow.com/a/16445086/1649353
Answered By - Ambuj Kathotiya
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.