You need layout inflater only when converting XML layouts to view hierarchies. When you create the view hierarchy in code, you don't need a layout inflater.
Replace this code:
ViewGroup viewGroup = (ViewGroup)this.getLayoutInflater().inflate(
null, p_rLayout);
viewGroup.addView(p_view);
setContentView(viewGroup);
with something like
p_rLayout.addView(p_view);
setContentView(p_rLayout);
to add the SurfaceView
to the RelativeLayout
(you probably want to adjust the layout params) and then add the RelativeLayout
as your content view.