Errors while using VideoView in Android
<p>The following sample code I am using from the API demo app for playing the streaming videos</p>

<p>public class VideoViewDemo extends Activity {</p>

<pre><code>/**
 * TODO: Set the path variable to a streaming video URL or a local media
 * file path.
 */
private String path = "";
private VideoView mVideoView;

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.videoview);
    mVideoView = (VideoView) findViewById(R.id.surface_view);

    if (path == "") {
        // Tell the user to provide a media file URL/path.
        Toast.makeText(
                VideoViewDemo.this,
                "Please edit VideoViewDemo Activity, and set path"
                        + " variable to your media file URL/path",
                Toast.LENGTH_LONG).show();

    } else {

        /*
         * Alternatively,for streaming media you can use
         * mVideoView.setVideoURI(Uri.parse(URLstring));
         */
        mVideoView.setVideoPath(path);
        mVideoView.setMediaController(new MediaController(this));
        mVideoView.requestFocus();

    }
}
</code></pre>

<p>}</p>

<p>I faced the following errors.</p>

<p>i> While playing the videos , if an incoming call comes &amp; the user receives &amp; then disconnects the call , then a black screen is displayed &amp; the video is no longer played again.</p>

<p>2> Similarly if an user rejects an incoming call , a black screen is displayed &amp; the video is no longer played.</p>

<p>3> When a low battery error message is displayed while a video is being played &amp; the user clicks on OK button of the error message , a black screen is displayed &amp; the video is no longer played.</p>

<p>4> When an incoming SMS comes while viewing the streaming video &amp; the user views the SMS &amp; closes it , a black screen is displayed &amp; the video is no longer played.</p>

<p>Kindly provide me the suggestions/sample code to handle the conditions to solve the errors.</p>

<p>Warm Regards,</p>

<p>CB</p>
