private ViewGroup CreateVideoView(SurfaceView surface) { try { RelativeLayout layout = new RelativeLayout(Context) { Id = surface.GetHashCode() }; LayoutParams videoLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layout.AddView(surface, videoLayoutParams); TextView text = new TextView(Context) { Id = layout.GetHashCode() }; LayoutParams textParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); textParams.AddRule(LayoutRules.AlignParentBottom, 1); textParams.BottomMargin = MStatMarginBottom; textParams.LeftMargin = StatLeftMargin; text.SetTextColor(Color.White); text.SetTextSize(ComplexUnitType.Sp, StatTextSize); layout.AddView(text, textParams); return(layout); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(null); } }