Android 1.5 api giving wrong output
<p>I am working with android 1.5 api, I know it is deprecated, but its client requirement. I am using following code to read Contacts address but every time it give address count zero. I am not able find out what is the problem</p>

<pre><code>private void getAddress(String _Id)
{
    Cursor curAddress=null;
    try
    {
        String addrWhere = Contacts.ContactMethods.PERSON_ID + " = ? AND " + Contacts.ContactMethods.KIND + " = ?"; 
        String[] addrWhereParams = new String[]{_Id, Contacts.ContactMethods.CONTENT_POSTAL_ITEM_TYPE};
        curAddress = _resolver.query(Contacts.ContactMethods.CONTENT_URI, null, addrWhere, addrWhereParams, null);
        int i=0;
        int aCount = curAddress.getCount();
        String[] aType = new String[aCount];
        String[] aAddrss = new String[aCount];
        while(curAddress.moveToNext()) 
        {
            aType[i] = curAddress.getString(curAddress.getColumnIndex(Contacts.ContactMethodsColumns.TYPE));
            aAddrss[i] = curAddress.getString(curAddress.getColumnIndex(Contacts.ContactMethodsColumns.DATA));
            i++;
        }
    }
    catch (Exception e)
    {
        Log.e(StaticVariables.TAG, "getAddress: " + e.getMessage());
    }
    finally
    {
        if(curAddress!=null) curAddress.close();
    }
}
</code></pre>
