com.activeandroid.content.ContentProvider Java Examples

The following examples show how to use com.activeandroid.content.ContentProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: From.java    From clear-todolist with GNU General Public License v3.0 5 votes vote down vote up
public <T extends Model> List<T> execute() {
	if (mQueryBase instanceof Select) {
		return SQLiteUtils.rawQuery(mType, toSql(), getArguments());
		
	} else {
		SQLiteUtils.execSql(toSql(), getArguments());
		Cache.getContext().getContentResolver().notifyChange(ContentProvider.createUri(mType, null), null);
		return null;
		
	}
}
 
Example #2
Source File: Model.java    From clear-todolist with GNU General Public License v3.0 5 votes vote down vote up
public final void delete() {
	Cache.openDatabase().delete(mTableInfo.getTableName(), idName+"=?", new String[] { getId().toString() });
	Cache.removeEntity(this);

	Cache.getContext().getContentResolver()
			.notifyChange(ContentProvider.createUri(mTableInfo.getType(), mId), null);
}
 
Example #3
Source File: From.java    From mobile-android-survey-app with MIT License 5 votes vote down vote up
public <T extends Model> List<T> execute() {
	if (mQueryBase instanceof Select) {
		return SQLiteUtils.rawQuery(mType, toSql(), getArguments());
		
	} else {
		SQLiteUtils.execSql(toSql(), getArguments());
		Cache.getContext().getContentResolver().notifyChange(ContentProvider.createUri(mType, null), null);
		return null;
		
	}
}
 
Example #4
Source File: Model.java    From mobile-android-survey-app with MIT License 5 votes vote down vote up
public final void delete() {
	Cache.openDatabase().delete(mTableInfo.getTableName(), idName+"=?", new String[] { getId().toString() });
	Cache.removeEntity(this);

	Cache.getContext().getContentResolver()
			.notifyChange(ContentProvider.createUri(mTableInfo.getType(), mId), null);
}
 
Example #5
Source File: MainActivity.java    From SectionCursorAdapter with Apache License 2.0 4 votes vote down vote up
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    String orderBy = ToasterModel.SHORT_JOB + " ASC, " + ToasterModel.NAME + " ASC";
    return new CursorLoader(this, ContentProvider.createUri(ToasterModel.class, null), null, null, null, orderBy);
}