问题
I have an app that I'm working on that uses openGL ES 2.0 on an android device. The app contains some buttons that are displayed using programmatic layout controls. This button pad is superimposed on an OpenGL Surface View.
When I run the app on the tablet the buttons appear AND the Surface View appears briefly, but then the Surface View is grey, the color of the background for the 3d model I've created. The app works on a Motorola Bionic, Android 4.1.2, but doesn't work on a Samsung Galaxy Tab/Pro, Android 4.4.2! Of course I would like it to work on both. I googled a solution that involves changing what part of the initial Activity you instantiate the GL Surface View, but I cannot find that solution on line now. It may have been deleted. I don't know. This is the error as I see it now.
W/ApplicationPackageManager﹕ getCSCPackageItemText()
E/MoreInfoHPW_ViewGroup﹕ Parent view is not a TextView
below is a log for the Samsung device.
10-10 14:27:03.723 30456-30462/org.android.airplane D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
10-10 14:38:55.833 1269-1269/org.android.airplane I/SELinux﹕ Function: selinux_android_load_priority [0], There is no sepolicy file.
10-10 14:38:55.833 1269-1269/org.android.airplane I/SELinux﹕ Function: selinux_android_load_priority , loading version is VE=SEPF_SM-T320_4.4.2_0018
10-10 14:38:55.833 1269-1269/org.android.airplane I/SELinux﹕ selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts
10-10 14:38:55.843 1269-1269/org.android.airplane D/dalvikvm﹕ Late-enabling CheckJNI
10-10 14:38:55.943 1269-1269/org.android.airplane W/ApplicationPackageManager﹕ getCSCPackageItemText()
10-10 14:38:55.983 1269-1269/org.android.airplane E/MoreInfoHPW_ViewGroup﹕ Parent view is not a TextView
10-10 14:38:56.083 1269-1269/org.android.airplane I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
OpenGL ES Shader Compiler Version: E031.24.00.07
Build Date: 01/22/14 Wed
Local Branch: base_au149_adreno_au169_patches
Remote Branch:
Local Patches:
Reconstruct Branch:
10-10 14:38:56.113 1269-1269/org.android.airplane D/OpenGLRenderer﹕ Enabling debug mode 0
10-10 14:38:58.823 1269-1269/org.android.airplane W/ApplicationPackageManager﹕ getCSCPackageItemText()
Here is some code that lets you see my view hierarchy. This code runs in the onCreate() method of a plain Activity.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// this is my view of buttons, made from a table of png images
APButtonManager mButtons = new APButtonManager(this);
// this is my view of OpenGL stuff
APGLSurfaceView myAPView = new APGLSurfaceView(this);
// this is how I superimpose them
RelativeLayout mRelative = new RelativeLayout(this);
mRelative.addView(myAPView);
mRelative.addView(mButtons);
myAPView.setPreserveEGLContextOnPause(true);
// I tried the line below to see if the OpenGL would appear
//this.setContentView(myAPView);
// I settle on this line since the one above doesn't do anything
setContentView(mRelative);
I don't know what to do. I would like an error that made more sense, but this is what I have. Any help would be appreciated.
来源:https://stackoverflow.com/questions/26455589/works-on-bionic-4-1-2-but-not-on-samsung-4-4-2