checking for empty values in textfield and spinner
<pre><code>Button btnSearch = (Button) pnlView.findViewById(R.id.btnSearch);
btnSearch.setOnClickListener(new OnClickListener() {@
    Override
    public void onClick(View v) {
        results.clear();
        if (txtPatientID.getText().equals("") &amp;&amp; txtFirstName.getText().equals("") 
         &amp;&amp; txtLastName.getText().equals("") &amp;&amp; txtDOB.getText().equals("") 
                          &amp;&amp; cboGender.getSelectedItem().equals("")) {
            Toast.makeText(getActivity(), 
                       "No criteria added", Toast.LENGTH_LONG).show();
            return;
        }
        new Async().execute();
    }
});
</code></pre>

<p>I have four text field and a spinner, when the user clicks search button, i need to display a message saying no criteria added. Its working, but i am not sure whether i am following the right approach in checking for empty value in textfield and spinner.</p>
