I'm trying to get a LiveFolder implementation working, but I can't
seem to be able to. I'm able to create the ContentProvider and the
items show up nicely. However, I can't seem to be able to return a
proper Intent in the Cursor from my ContentProvider to launch my
activity. Relevant bits of my code:
* Creating the LiveFolder:
if (LiveFolders.ACTION_CREATE_LIVE_FOLDER.equals(action)) {
setResult(RESULT_OK, createLiveFolder(this,
CONTENT_URI,
"Favorites", R.drawable.ic_favorites_folder));
}
private static Intent createLiveFolder(Context context, Uri
uri,
String name, int icon) {
final Intent intent = new Intent();
intent.setData(uri);
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME,
name);
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
Intent.ShortcutIconResource.fromContext(context,
icon)
);
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE,
LiveFolders.DISPLAY_MODE_LIST);
return intent;
}
* From the provider (this is how I create the Intent I pass in the
LiveFolders.INTENT column):
i = new Intent("com.myapp.intent.details");
i.putExtra(MyApp.KEY_RESOURCE_NAME, name);
i.putExtra(MyApp.KEY_RESOURCE_TYPE, type);
* From my Manifest:
<activity android:name=".MyDetailsActivity">
<intent-filter>
<action
android:name="com.myapp.intent.details" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
When I click on an item I get an "Application not installed on your
phone" error. Logcat says:
I/ActivityManager( 74): Starting activity: Intent
{ act=android.intent.action.VIEW dat=Intent
{ act=com.myapp.intent.details (has extras) }
flg=0x10000000 }
Basically, for some reason, the Intent I return in the cursor is
passed as the data of the actual intent that it tries to fire, which
has a VIEW action. Why is this happening?
I tried to post as little and as relevant code I could. If you think I
should post more, let me know.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.