Code example for Surface

0
			@Override 
			public void onSurfaceTextureAvailable(SurfaceTexture surface,
					int width, int height) {
				try { 
					Log.d("Debug", "SurfaceTextureAvailable");
					Surface s = new Surface(surface);
					mp.setSurface(s);
					String url = "http://daily3gp.com/vids/747.3gp";
					mp.setDataSource(MainActivity.this, Uri.parse(url));
					mp.prepareAsync();
					// mp.start(); 
				} catch (Exception e) {
					e.printStackTrace();
				} 
 
			} 
		}); 
		 
		//setContentView(mTextureView); 
		// Connect a play button 
		Button playButton = (Button) findViewById(R.id.buttonPlay);