我正在尝试更新没有插入int值的数据库insertedUri = getApplicationContext().getContentResolver().update(
pm2_Contract.pm2_MoviesEntry.pm2_buildMoviesUri(100),
locationValues,
"Movie_ID_test",
null);
public static Uri pm2_buildMoviesUri(long id) {
return ContentUris.withAppendedId(pm2_CONTENT_URI, id);
}
pm2_buildMoviesUri返回url的方法:
ContentValues locationValues = new ContentValues();
locationValues代码是:
def info(self, msg, *args, **kwargs):
if 'extra' not in kwargs:
kwargs['extra'] = dict()
kwargs['extra']['session_id'] = self.session_id
答案 0 :(得分:1)
SQLite update
操作返回受影响行的count(int),而不是URI
。所以,在下一个作业中:
insertedUri = getApplicationContext().getContentResolver().update(
pm2_Contract.pm2_MoviesEntry.pm2_buildMoviesUri(100),
locationValues,
"Movie_ID_test",
null);
insertedUri 包含数据库更新操作所影响的行数的值。