好吧也许我的这个叫法不准确,但是就是这个意思,目前我碰到的两个线程: 1、UI线程,要想操作UI必须在主线程
2、OPENGL ES线程,要想使用它的方法(GL10、GL20),必须在GLSurfaceView.Renderer线程内部使用,在外部使用的话,要不报“call to OpenGL ES API with no current context”的错误,要不就不显示
onSurfaceCreated(GL10 gl, EGLConfig config) 这个方法内部才可以创建纹理和初始化着色器
onSurfaceChanged(GL10 gl, int width, int height) 这个方法内部设置视窗、投影、摄像机
3、添加自己的线程
new Thread(){
public void run(){
try{
//Thread.sleep(3000);
Message msg = new Message();
msg.what = BeatMouseActivity.TO_MAINUI_VIEW;
BeatMouseActivity.mHandler.sendMessage(msg);//向Handler发送消息,
} catch (Exception e){
e.printStackTrace();
}
}
}.start();
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what){
}}}