Code example for ContentProviderClient

Methods: getLocalContentProvider

0
	public <T extends ActiveRecord> List<T> select(Uri uri, String sortOrder) {
		ContentResolver resolver = Mechanoid.getContentResolver();
		 
		ContentProviderClient client = resolver.acquireContentProviderClient(uri);
		 
		MechanoidContentProvider provider = (MechanoidContentProvider) client.getLocalContentProvider();
		 
		List<T> records = provider.selectRecords(uri, this, sortOrder);
		 
		return records;
	} 
	 
	/** 
	 * <p>Select records using this query</p> 
	 * @param uri The ContentProvider Uri to query for 
	 * @return The results as active records 
	 */	 
	public <T extends ActiveRecord> List<T> select(Uri uri) {
		ContentResolver resolver = Mechanoid.getContentResolver();
		 
		ContentProviderClient client = resolver.acquireContentProviderClient(uri);