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.