Bug Fix: Crash on preparing delivery reports

This commit is contained in:
Mathieu Maret 2012-10-05 11:23:23 +02:00
parent a4faf1dc43
commit bf00fb48c6

View File

@ -240,7 +240,13 @@ public class DeliveryDbAdapter {
public String nameFromNumber(String number) {
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
Cursor c = mCtx.getContentResolver().query(uri, new String[]{PhoneLookup.DISPLAY_NAME},null, null, null);
Cursor c = null;
try {
c = mCtx.getContentResolver().query(uri, new String[]{PhoneLookup.DISPLAY_NAME},null, null, null);
} catch (Exception e) {
return "";
}
/*Uri contactUri = Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, Uri.encode(number));
Cursor c = mCtx.getContentResolver().query(contactUri, new String[] { Phones.DISPLAY_NAME }, null, null, null);
*/