title: Unfortunately, "app" has Stopped in Android Studio
body: <p>I am new to developing android. And I got after writing my code and running the debugger: "Unfortunately App has stopped"</p>
  
  <p>my main.java:</p>
  
  <pre><code>package com.stream.streamvideo;
  import android.app.Activity;
  import android.media.AudioManager;
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.SurfaceHolder;
  import android.view.SurfaceView;
  public class main extends Activity implements     SurfaceHolder.Callback,MediaPlayer.OnPreparedListener {
  private MediaPlayer mediaPlayer;
  private SurfaceHolder vidHolder;
  private SurfaceView vidSurface;
  String vidAddress = "https://archive.org/download/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4";
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      vidSurface = (SurfaceView) findViewById(R.id.surfView);
      vidHolder = vidSurface.getHolder();
      vidHolder.addCallback(this);
      setContentView(R.layout.activity_main);
  }
  @Override
  public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
      // TODO Auto-generated method stub
  }
  @Override
  public void surfaceCreated(SurfaceHolder arg0) {
  //setup
      try {
          mediaPlayer = new MediaPlayer();
          mediaPlayer.setDisplay(vidHolder);
          mediaPlayer.setDataSource(vidAddress);
          mediaPlayer.prepare();
          mediaPlayer.setOnPreparedListener(this);
          mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
      }
      catch(Exception e){
          e.printStackTrace();
      }
  }
  
  @Override
  public void surfaceDestroyed(SurfaceHolder arg0) {
      // TODO Auto-generated method stub
  }
  
  @Override
  public void onPrepared(MediaPlayer mp) {
  //start playback
      mediaPlayer.start();
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  
  }
  </code></pre>
  
  <p>My activity_main.xml:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#000000"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" &gt;
      &lt;SurfaceView
           android:id="@+id/surfView"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>i dont know where the problems are
  Does anyone know where my problem is?</p>