1

I have successfully launched my app from a chrome on android using an intent uri (see Make a link in the Android browser start up my app?) and now I would like to automate testing for some generator that I wrote to create launchable intent uris pass different parameters as extras into my browsable Activity.

But how to test this? I figured I could essentially:

- run my generator to get some huge intent uri string with tons of parameters:

"intent:#Intent:component=some/Activity;param1=value;param2=value2;...;end"

- then construct an intent in the test from the string:

Intent.parseUri(generatorOutput,URI_INTENT_SCHEME);

- and find my extras:

Intent.getExtras().keySet();

But getExtras always returns null, so this means that

Intent.parseFrom(originalIntent.getUri(URI_INTENT_SCHEME), URI_INTENT_SCHEME) != originalIntent

Does anyone know if there is another way to construct an intent from an intent uri and actually get all the extras populated. The functionality is obviously available in android since android does this.

  • This looks like it should work. Please post the actual code you use to do this. Maybe there's something different about it. – David Wasser May 12 '15 at 15:51
  • Also, after calling `parseUri()` you should print out what the `Intent` looks like. Especially look at the ACTION and the DATA parts. – David Wasser May 12 '15 at 15:52

0 Answers0