I have 3 elements to my application: 1. UI (activity) 2. Model (class) 3. content provider - provides data from a database
In order for the model class to access the data from the content provider I need the UI (activity) to pass it a ContentResolver - this way I can create a cursor in the model class:
cursor = mContentResolver.query(
MyobiliseData.CONTENT_URI_RUNSUMMARY, // The content URI of the words table
projection, // The columns to return for each row
selectionClause, // Selection criteria
selectionArgs, // Selection criteria
null); // The sort order for the returned rows
Is this acceptable practice, or is there a better way to call the content provider from a non-activity class?
thanks
anton