Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i check if imageview is empty or not

Tags:

java

android

i have an application that has form and there is some fields the user should fill it ,i want to put the button "Next" disable until the user fill this fields.

the fields is:(iamgeView, EditText,Spinner..)

i know how to check the text Edit but how can i check if the user fill the image and spinner or not (image view will let the user choose an image from native gallery)

What i want: how can i check if the user fill the image and spinner or not? this is my code to check the Edit Text

  private boolean checkEditText2(EditText edit) {
    return edit.getText().length() == 0;
}
like image 390
user1257040 Avatar asked Mar 14 '12 17:03

user1257040


1 Answers

In xml file your image have not android:src="" and android:backgroud=""

   if(null!=imgView.getDrawable())
     {
        //imageview has image
     }else{
       //imageview has no image  
     }
like image 57
Samir Mangroliya Avatar answered Sep 21 '22 20:09

Samir Mangroliya