Thanks, Dianne. You're right - I played with it a bit more and now
understand it better.
Intent i = new Intent("randomstring");
startActivity(i);
The above does throw the exception as expected.
Intent i = new Intent("randomstring");
startActivity(Intent.createChooser(i, "my title");
This does not throw an exception. I get a dialog box with "my title"
as the title and the content is "No application can perform this
action." (I typed it incorrectly in my original message.) The dialog
has no buttons.
So it looks as if when I explicitly request the activity chooser, no
exception is thrown for startActivity(). That wasn't clear to me.
Still seems a bit odd, but maybe that's just me.
On Jun 29, 1:35 pm, Dianne Hackborn <[email protected]> wrote:
> You haven't provided enough information to help. Fwiw, the exception -does-
> get thrown if there is no activity matching the intent given to
> startActivity(), and the system does not display such a dialog. So I would
> assume there is something going on in your app doing this, or you are doing
> something different from what I am interpreting your description to be.
>
>
>
> On Mon, Jun 29, 2009 at 8:40 AM, Nmix <[email protected]> wrote:
>
> > According to the doc, if the intent in startActivity(intent) is not
> > found, there will be an exception raised. Therefore I use a try/catch
> > block. However, even if I use a random string as the intent, the
> > promised exception does not occur.
>
> > Instead I see a dialog that says: "No application can perform this
> > function". I also get the same dialog if the intent is valid (picked
> > up by an app) but apparently doesn't want to act when the extras are
> > not what the app expects (e.g. my earlier question about
> > Intent.ACTION_SEND and mime types).
>
> > I am using the 1.5_r2 SDK on an AVD running 1.5, with the app running
> > at version 1.1 (sdk=2). Is this a doc error, a bug or am I
> > misunderstanding something? Can I simply delete the try/catch block?
> > Thanks.
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> 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 [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
-~----------~----~----~----~------~----~------~--~---