By pigsybeard
on Wed, 06/20/2012 - 17:02
Hi
I have read the question that CliffWoo has asked.He wants to make a videoView on GLSurfaceView.And I need to make some Button and textView on above the VideoView,too. So I used the solution that answered for CliffWoo.
But when I want to do something else, I meet more question.
I want to change the text in textView above the GLsurfaceView, when detect the aim image. so I write like this:
[CODE]
//in the QCARSampleActivity.java
overlayView = View.inflate(QCARSampleActivity.this, R.layout.main, null);
addContentView(overlayView, new LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
mButton = (Button) overlayView.findViewById(R.id.Button01);
overlayView.setVisibility(View.VISIBLE);
//here mButton is a public member
[/CODE]
and in the ImageTargets.java, I do like these below in ImageTargetsRenderer.java
[CODE]
//in ImageTargetsRenderer.java
private ImageTargets preTargets;
public void onDrawFrame(GL10 gl){
if (!mIsActive)
return;
// Call our native function to render content
Log.d("ImageTargets","detected");
mButton.setText("lol! I change the text in the button!!!");
}
}
public ImageTargetsRenderer(ImageTargets imageTarget){
super();
preTargets = imageTarget;
}
[/CODE]
in the ImageTargets.java , I have already changed the Methods of Construction
[CODE]
protected QCARSampleRenderer createRenderer()
{
return new ImageTargetsRenderer(this);
}
[/CODE]
But this time when I detected the aim image ,the programe closed , and the file named GLSurfaceView.class wil be open in Eclipse.
And there is no error log in DDMS.
I need your help to solve the Problem. many thanks~!:)
Re: How to operate above the GLsurfaceView
Re: How to operate above the GLsurfaceView
Re: How to operate above the GLsurfaceView