import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class ProjectActivity extends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button tut1 = (Button) findViewById(R.id.tutorial1);
tut1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent("android.intent.action.TUTORIALONE"));
}
});
}
}
遵循了 youtube 教程,但我在此行中遇到错误:
setContentView(R.layout.main);
“按钮无法解析为类型”
我是android dev的新手,所以我很困惑。帮助!