if( txt.equals("Apple"))
  {
        Toast.makeText(this, "Times up", Toast.LENGTH_SHORT).show();
        AlertDialog ad = new AlertDialog.Builder(this).create();  
        ad.setCancelable(false); // This blocks the 'BACK' button  
        ad.setMessage("You win");  
        ad.setButton("OK", new DialogInterface.OnClickListener() {  
           @Override  
          public void onClick(DialogInterface dialog, int which) {  
              dialog.dismiss();                      
            }  
        });
       ad.show(); 
  }
what should i write to compare Apple text with the image of imageview