I wish to know how in java I should receive these parameters.
I do know how开发者_开发百科 to deliver parameters via adb shell am start command but I still have a
problem to get them in java (android) code.
My class extends InstrumentationTestCase and not Activity class!!!
So I cannot perform: this.getIntent().
I anderstand that I need to create intent doing: Intent intent = new Intent(Intent.someAction);
Can you help me to find out what action should I use here.
I also read that there are secondary attributes: category, type, component, extras. I know that I also need to update the manifest file accordingly. Sorry for so many q/a.
Thanks a lot for your assist.
You can use "adb shell am" for several things: - manually start activities using intents - manually broadcast intents (for broadcastreceivers mostly) - start an Instrumentation - ...
It seems most of your question is about the concept Intent. It would be good to read upon that.
- Create a class that extends
InstrumentationTestRunner
, - Override the method
onCreate(Bundle args)
, and - configure your
AndroidManifest.xml
to use this new runner.
精彩评论