I have a custom view that draws HUD:
Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<VideoView
android:id="@+id/videoView1"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.widgets.HUD
android:id="@+id/hud"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.hud_fragment, container, false);
frameLayout = (FrameLayout) view.findViewById(R.id.frameLayout);
hudWidget = (HUD) view.findViewById(R.id.hudWidget);
videoView = (VideoView) view.findViewById(R.id.videoView1);
videoView.setVideoURI(Uri.parse("http://88.150.210.138:5001/spor"));
videoView.start();
frameLayout.removeView(hudWidget);
frameLayout.addView(hudWidget);
hudWidget.bringToFront();
return view;
}
I play an RTSP stream on my VideoView as soon as the video starts playing it looks like that:
How can i force the HUD to draw on top of the VideoView? HUD extends SurfaceView
Project
The project I'm trying to add the the VideoView is DroidPlanner You can try cloning and see the problem. (Need to add the VideoView manually because it's not in the repo).
view.bringtoFront()
if your widget extends View . Your layout definition seems correct. – Coweycom1
tocom
it causes Path problems for Git on Windows. – Bunkmate