Search code examples
androidandroid-intentadb

Send Explict/Implict Intent to Internal View/Activity


I'm experimenting here...

Ok, so I have a relativelayout with 3 views. 2 webviews: one on the bottom full width taking up 20% verically. One on the right side taking up 30% of the screen. And a videoview taking up the remaining space.

For my purposes, I would like to change the video in the videoview using adb shell commands instead of java. Usually when I interact with apps from the android shell its something like this...

    Adb shell am start android.intent.action.MAIN com.android.browser.BrowserActivity

But, this opens up a whole new window. I don't want to open another window, I want to interact with the present activities on the screen, but through the android shell.

Let's say like playing different videos in the video view and the app remains open, the only thing that changes upon command is the video playing in the view.

Can anyone point me in the right direction or show me some possiblities of this.

Thank you in advance.


Solution

  • You activity should register a broadcast receiver which will modify the content of the view when called.

    Once you have your activity displayed, you can launch the broadcast intent from the console. More information about adb shell am command:

    Android adb shell am broadcast: Bad component name

    http://www.anddev.org/using_the_am-tool_start_activities-intens_from_a_shell-t368.html