80,337
社区成员
发帖
与我相关
我的任务
分享
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/loading_bg"
android:orientation="vertical">
<FrameLayout
android:id="@+id/lLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/loading_bg"
android:orientation="vertical">
<com.xxx.xxx.app.web.MySurfaceView
android:id="@+id/sv"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</com.xxx.xxx.app.web.MySurfaceView >
......
.....
mSurfaceView = (MySurfaceView) mMainView.findViewById(R.id.sv);
SurfaceHolder sh = mSurfaceView.getHolder();
sh.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
sh.addCallback(this);
.....
public class MySurfaceView extends SurfaceView {
private static final String TAG ="BesTVSurfaceView";
public MySurfaceView (Context context) {
super(context);
}
public MySurfaceView (Context context, AttributeSet attrs) {
super(context, attrs);
}
public MySurfaceView (Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
private void initView() {
Log.d(TAG,"initView");
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
initView();
}
}