How to know if Contact exists like a number in android
<p>I am using the below code to know if any contact exists with a number in android native contacts</p>

<pre><code>public boolean contactExists(Context context, String number) {
            /// number is the phone number
            Uri lookupUri = Uri.withAppendedPath(
            PhoneLookup.CONTENT_FILTER_URI, 
            Uri.encode(number));
            String[] mPhoneNumberProjection = { PhoneLookup._ID, PhoneLookup.NUMBER, PhoneLookup.DISPLAY_NAME };
            Cursor cur = context.getContentResolver().query(lookupUri,mPhoneNumberProjection, null, null, null);
            try {
               if (cur.moveToFirst()) {
                  return true;
            }
            } finally {
            if (cur != null)
               cur.close();
            }
            return false;
            }
</code></pre>

<p>my problem is that if i get a number with country code added.</p>

<p>so,can i compare only last 7 numbers in my query</p>
