// The incoming URI matches the Note ID URI pattern
private static final int INDEXER_ID = 2;
+ private static final int INDEXER_IDAD = 3;
+
static {
/*
// to a index ID operation
sUriMatcher.addURI("de.android.test3.provider", Indexer.Index.TABLE_NAME + "/#", INDEXER_ID);
+ sUriMatcher.addURI("de.android.test3.provider", Indexer.Index.TABLE_NAME + "/" + Indexer.Index.COLUMN_NAME_ID_AD + "/#", INDEXER_IDAD);
+
/*
* Creates and initializes a projection map that returns all columns
// the position of the note ID itself in the incoming URI
uri.getPathSegments().get(1));
break;
-
+
+ case INDEXER_IDAD:
+ qb.setProjectionMap(sIndexerProjectionMap);
+ qb.appendWhere(
+ Indexer.Index.COLUMN_NAME_ID_AD + // the name of the ID column
+ "=" +
+ // the position of the Advertisement ID itself in the incoming URI
+ uri.getPathSegments().get(2));
+ break;
default:
// If the URI doesn't match any of the known patterns, throw an exception.
throw new IllegalArgumentException("Unknown URI " + uri);
ContentValues values = new ContentValues();
values.put(Indexer.Index.COLUMN_NAME_PATH, "18188181");
values.put(Indexer.Index.COLUMN_NAME_ID_AD, "22");
- Uri probando = Uri.parse("content://" + "de.android.test3.provider" + "/" + "indexer");
- this.context.getContentResolver().insert(probando, values);
+ Uri probando = Uri.parse("content://" + "de.android.test3.provider" + "/" + "indexer" + "/idad/" + "22");
+
Cursor cursor = this.context.getContentResolver().query(probando, null, null, null, null);
+ if (cursor != null) {
+ }
+ //this.context.getContentResolver().insert(probando, values);
downloadAds((Integer) objects.get("id"), (String)objects.get("domain"), (String)objects.get("link"));
}
} catch (URISyntaxException e) {