从一个Activity跳转到ListActivity
从一个Activity跳转到ListActivity,报异常
代码如下
MySudoku是个Activity,里面有个方法
private void startGame(int i){
Log.d(TAG, "clicked on "+ i);
Intent intent = new Intent(MySudoku.this, SudokuListActivity.class);
intent.putExtra(Game.KEY_DIFFICULTY, i);
startActivity(intent);
}protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.sudoku_list);
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, puz));
diff = getIntent().getIntExtra(Game.KEY_DIFFICULTY,
Game.DIFFICULTY_KIDS);
}<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>