List of usage examples for android.content ContentProviderClient getLocalContentProvider
public @Nullable ContentProvider getLocalContentProvider()
From source file:edu.stanford.mobisocial.dungbeetle.DBHelper.java
public static DBHelper getGlobal(Context context) { ContentProviderClient cpc = context.getContentResolver() .acquireContentProviderClient(DungBeetleContentProvider.CONTENT_URI); try {/* ww w. j a v a 2 s .c om*/ DungBeetleContentProvider dbcp = (DungBeetleContentProvider) cpc.getLocalContentProvider(); return dbcp.getDBHelper(); } finally { cpc.release(); } }
From source file:com.robotoworks.mechanoid.db.SQuery.java
private MechanoidContentProvider getContentProvider(Uri uri) { if (mProvider != null) { return mProvider; }/* w ww.ja v a 2 s .c o m*/ ContentResolver resolver = Mechanoid.getContentResolver(); ContentProviderClient client = resolver.acquireContentProviderClient(uri); MechanoidContentProvider provider = (MechanoidContentProvider) client.getLocalContentProvider(); return provider; }