Creating activity to open YouTube and search automaticlly
<p>so I wasn't sure how to put this in the title, but what I have been trying to do is making my application open, lets say YouTube and then enter a search automaticlly (given previously). Here is my code which makes it easier to explain.</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Get the URL and search from the intent
    Intent intent = getIntent();
    String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);

    // Open browser and auto search in searchbar
    if (!message.startsWith("http://") &amp;&amp; !message.startsWith("https://"))
    message = "http://" + message + ".com";
    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(message));
    startActivity(browserIntent);
}
</code></pre>

<p>So What I wanted to do was open up YouTube (this works fine), however I want to use the next words put into the search (split with a space) to be typed into the searchbar in YouTube.</p>

<ol>
<li><p>What you enter: Youtube funny videos</p></li>
<li><p>Delivers message into the second activity: opens the URL "Youtube" (works fine so far)</p></li>
<li><p>The activity recognizes the other parts of message after "Youtube" (split with space) and puts these into the search bar in YouTube.</p></li>
</ol>

<p>How can I do this?</p>
