这里有什么问题导致异常发生?我在这里没有发现任何问题。任何人都可以看看这个:
private Cursor getAllPhoneNumbersForNamesLike(String str){
Cursor tempContact=null;
tempContact=this.getContentResolver().query(uriContact,null,"display_name like ?",new String[]{tokenLike+"%"},null);
if(tempContact!=null && tempContact.getCount()>0){
try{
tempContact.moveToFirst();
Toast.makeText(this,tempContact.getString(tempContact.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)), Toast.LENGTH_LONG).show();
}catch(Exception e){
Toast.makeText(this, "Inside getAllPhoneNumbersForNamesLike catch: "+e.toString(), Toast.LENGTH_LONG).show();
return null;
}
return this.getContentResolver().query(uriSmsRead,null,inClause,null,null);
}
else
return null;
}