title: Android Network Operation on another Thread than UI
body: <p>I am playing an stream from Internet and because long processes such as network operation should not be handled on UI Thread, I'm using AsyncTask.
  In Main Thread I set some specification of videoView:</p>
  
  <pre><code>public void onCreate(Bundle icicle) {
      super.onCreate(icicle);
      setContentView(R.layout.videoview);
      progressDialog = ProgressDialog.show(this, "Loading", "Please Wait", true, true);
  
      videoView = (VideoView) findViewById(R.id.surface_view);
      videoView.setVideoPath(ChannelPath);
      videoView.setMediaController(new MediaController(this));
  
      new LoadStream().execute("");
  }
  </code></pre>
  
  <p>And in AsyncTask I start the video:</p>
  
  <pre><code>private class LoadStream extends AsyncTask&lt;String, Void, Void&gt; {
      protected Void doInBackground(String... urls) {
              videoView.setOnPreparedListener(new OnPreparedListener() {
                  public void onPrepared(MediaPlayer mp) {
                      videoView.start();
                      progressDialog.dismiss();
                  }
              });
          return null;
      }
  }
  </code></pre>
  
  <p>I tried to have all the parts related to videoView on AsyncTask but was unable to setVideoPath and setMediaController on AsyncTask.
  I am wondering which part is exactly the time consuming part? Is my code alright? or I'm still having the long process on UI Thread?</p>