我很感激你的评论。附上我的实现供您参考。GLSurfaceView 无法在锁定屏幕上显示。我的布局是这样的:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_lockscreen_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<FrameLayout
android:id="@+id/my_lockscreen_clock"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:visibility="gone"/>
在 LockScreen.java 构造函数上添加 GLSurfaceViewn:
RelativeLayout mRootLayout = (RelativeLayout) findViewById(R.id.my_lockscreen_root);
View myGLSurfaceView = new MyGLSurfaceView(mContext, mCallback);
FrameLayout.LayoutParams layoutparams =
new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mRootLayout.addView(mUnlockWidget, 0, layoutparams);