How to pass string from OnStartCommand into OnHandleIntent in an IntentService?
<p>Android/Java noob here.  I have a URL that I am discovering in another part of my application.  I am successfully passing that URL as a string into an intent service's OnStartCommand.  I would  then like to make that string containing my URL available to HttpURLConnection residing in a thread in OnHandleIntent as shown below.  How can I get I get the URL within the myUrl string into OnHandleIntent?</p>

<pre><code>@Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        String myUrl;
        myUrl = intent.getExtras().getString("myUrl");

         return super.onStartCommand(intent, flags, startId);   
    }

    @Override
    protected void onHandleIntent(Intent intentNotify) {
        try {
              URL url = new URL("myUrl");
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
              readStream(con.getInputStream());
              } catch (Exception e) {
              e.printStackTrace();
            }
    }
</code></pre>
