Unfortunately the exception could only happen in Home when it ultimately
tries to persist itself, which is long after the app is involved, so any
exception would result in home crashing.

Fwiw, the API to turn an Intent into a URI string (which is the only form
that is safe to put in persistent storage) is this:
http://developer.android.com/reference/android/content/Intent.html#toUri(int)

<http://developer.android.com/reference/android/content/Intent.html#toUri(int)>It
certainly should explain more about the limitations on the extras that are
supported. :}

For now, here is the source code where you can see the types it handles:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/content/Intent.java;h=2acc4a05792ae50f5c03c92749bcf35072ccea64;hb=master#l5379
<http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/content/Intent.java;h=2acc4a05792ae50f5c03c92749bcf35072ccea64;hb=master#l5379>
On Sun, Aug 29, 2010 at 12:44 PM, Bob Kerns <r...@acm.org> wrote:

> Thanks for the heads-up.
>
> This strikes me as an unnecessary inconsistency making the API more
> complex and hard to understand.
>
> But it strikes me as a more serious flaw that it does not cause a
> visible exception at the point of creating the shortcut. Rather than
> logging it and ignoring it, and creating a BOGUS shortcut without the
> data -- it should fail, visibly, without persisting anything.
>
> Yes, I realize it will be the Launcher that reports this rather than
> the faulty app. An unfortunate consequence of using intents for this
> task.
>
> Visibly, because the failure is important to the end user, but it also
> helps developers get it right, too. You may want to log a more
> detailed explanation than you'd want to put in an end-user message.
>
> On Aug 27, 11:49 pm, Romain Guy <romain...@android.com> wrote:
> > I should have been clearer: extras of type array are not supported by
> > Launcher. Bundles/Parcelables are used for IPCs but not for long term
> > persistence (this would cause tons of compatibility issues across
> > versions.) Therefore, Home does not save intents (therefore shortcuts)
> > as binaries, but as URIs. The URI form of intents does not support
> > arrays.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to