private void stopStream() { if (stream != null) { View v = this.findViewById(android.R.id.content); R5VideoView videoView = (R5VideoView) v.findViewById(R.id.video); videoView.attachStream(null); stream.stop(); stream = null; } setStreaming(false); }