Need assistance with Android || operator
<p>I want to say, 'Search for the user's name OR the user's number, but this doesn't work :</p>

<pre><code>if (wp.getName().toLowerCase(Locale.getDefault())   
    .contains(charText)) || (wp.getPhone().toLowerCase(Locale.getDefault())  
    .contains(charText))  
</code></pre>

<p>Any ideas on how I could get this working? Here's my full code :      </p>

<pre><code> public void filter(String charText) {
            charText = charText.toLowerCase(Locale.getDefault());
    //        _data is our list of contacts
            _data.clear();
    //        If there is nothing in the searchview, if the charText length is 0,
    //        then show all the contacts
            if (charText.length() == 0) {
                _data.addAll(arraylist);
    //            or else....
            } else {
                for (SelectContact wp : arraylist) {
    //                If a contact's name matches the input thus far, which is charText, or their number matches it,
    //                then include it in the listview.
                    if (wp.getName().toLowerCase(Locale.getDefault())
                            .contains(charText)) || (wp.getPhone().toLowerCase(Locale.getDefault())
                            .contains(charText))
                         {

                            _data.add(wp);
                        }
                }
            }
            notifyDataSetChanged();
        }
</code></pre>