我已经实现update()
的ContentProvider
,并使用通知给观察者getContext().getContentResolver().notifyChange(uri, null);
我显而易见的需要是,每当只有一行生效时我想用行特定的uri通知,但是找不到这样做的方法.一个额外的查询就像"select id where selectionArgs"
可以做到这一点,但这将是一个愚蠢的方式.
onchange(boolean, uri)
得到完整的uri而不是特定的行,容易理解这是因为ContentProvider.update()
发送相同.
some code for more clarity
Run Code Online (Sandbox Code Playgroud)
MyContentProvider的update()方法
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
Log.d("TAG", "update " + uri.getPath());
int count = 0;
switch (uriMatcher.match(uri)) {
case BOOKS:
count = booksDB.update(DATABASE_TABLE, values, selection, selectionArgs);
break;
case BOOK_ID:
count = booksDB.update(DATABASE_TABLE, values,
_ID + " = " + uri.getPathSegments().get(1)
+ (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' …
Run Code Online (Sandbox Code Playgroud) 你们中的一些人可能知道使用Crittercism dSYM插件可以自动将jenkins的iOS符号文件(dSYM)上传到生命服务器.
我正在寻找类似的插件,它可以直接从jenkins上传android proGuard映射文件("mapping.txt")到crittercism.
那些有相关想法的人,请分享你的想法.
我想在我的谷歌眼镜应用程序中启动图库来选择图像.对于Android移动它是直的
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, REQ_SELECT_FILE);
Run Code Online (Sandbox Code Playgroud)
当我在玻璃中运行相同的代码时,它会失败并出现错误
07-29 16:12:45.941:E/AndroidRuntime(15847):android.content.ActivityNotFoundException:找不到处理Intent的Activity {act = android.intent.action.GET_CONTENT}
似乎相关的组件不是gdk的一部分.那应该是什么选择.我确定他们必须提供一些其他方式来使用保存在设备上的图像.任何指针围绕着该wd表示赞赏.