QuizActivity: -
这是我的第二个活动,但它不适用于ActionBarActivity所需的appcompat v7。现在得到代码粗体的错误,请帮忙
公共类QuizActivity扩展了ActionBarActivity ,这一行中的错误是“类”QuizActivity'必须被声明为abstract或在CallBack中实现抽象getSuppourtFragment()
“
MainActivity: -
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button startButton = (Button)findViewById(R.id.button);
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, QuizActivity.class);
startActivity(intent);
}
});
}
}
第二项活动: -
package quizapp.fyp.shanio.quizapp;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
public class QuizActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
}
}