public static ObjectInfo getObjectInfoByObjectInfoName(Context context, String name) { if ((TextUtils.isEmpty(name)) || (context == null)) { return null; } String where = ObjectInfoColumns.OBJECT_NAME + "='" + name + "'"; Cursor cursor = null; ContentResolver resolver = context.getContentResolver(); try { cursor = resolver.query(ObjectInfoColumns.OBJECT_LEFT_JOIN_ALL, null, where, null, null); if (cursor != null) { if (cursor.moveToFirst()) { ObjectInfo objectInfo = ObjectInfo.CreateFromDB(cursor); return objectInfo; } } } catch (Exception e) { } finally { if (cursor != null) { cursor.close(); } } return null; }