我想,当你点击打开一个新屏幕(Activity),但有问题时,新屏幕打不开。对代码做了哪些修改,让新窗口打开了?
package com.android.yalt;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MainActivity extends Activity implements OnClickListener {
Button btnny;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnny = (Button) findViewById(R.id.ny);
btnny.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.ny:
startActivity(NY.class);
break;
default:
break;
}
}
private void startActivity(Class<NY> class2) {
// TODO Auto-generated method stub
}
}