我有一个小应用程序,我实现了一个表面视图。现在取决于某些条件(时间)我想将屏幕更改为不同的布局。如何在以下代码中执行此操作。
我正在做的事情的草图。
public class df extends Activity
{
public void onCreate(Bundle savedInstanceState) {
}
class Panel extends SurfaceView implements SurfaceHolder.Callback {
public Panel(Context context){
super(context);
}
public void onDraw(Canvas canvas) {
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
// TODO Auto-generated method stub
}
public void surfaceCreated(SurfaceHolder holder) {
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
boolean retry = true;
_thread.setRunning(false);
while (retry) {
try {
_thread.join();
retry = false;
} catch (InterruptedException e) {
// we will try it again and again...
}
}
}
}