在我试图让 LiveFolders 工作的绝望中,我在我的LiveFolder
ContentProvider
:
public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
MatrixCursor mc = new MatrixCursor(new String[] { LiveFolders._ID, LiveFolders.NAME, LiveFolders.INTENT } );
Intent i = null;
for (int j=0; j < 5; j++) {
i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com/"));
mc.addRow(new Object[] { j, "hello", i} );
}
return mc;
}
在所有正常情况下,单击 LiveFolder 中的项目时,它应该启动浏览器并显示 Google 主页。但事实并非如此。它给出了一个Application is not installed on your phone
错误。不,我没有为我的 LiveFolder 定义基本意图。
logcat
说:
I/ActivityManager( 74): Starting activity: Intent { act=android.intent.action.VIEW dat=Intent { act=android.intent.action.VIEW dat=http://www.google.com/ } flg=0x10000000 }
似乎它嵌入了Intent
我给它的data
部分实际开除Intent
。为什么要这样做?我真的开始相信这是一个平台错误。
更新:我已经提交了一个问题并删除了 LiveFolders 功能。当我在这里或那里得到澄清这件事的回复时,我会将它包含在我的应用程序中。如果我有时间,我想我会为那个问题上传一个演示应用程序。
更新:我收到通知说赏金将在 3 天后到期。没人要吗?:)
2010 年 4月 25 日更新:我已经更新了 Android 项目的问题并上传了一个测试应用程序。如果有人可以在设备上测试这个应用程序会很好,也许这是一个非常微妙的问题,它只出现在模拟器上。