我想在列表视图中单击项目时打开一个新活动。这个怎么做。?这是代码:
package com.example.c_progams;
公共类 Second_listview 扩展 ListActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.second_listview);
setListAdapter (new ArrayAdapter<String>(this, R.layout.second_listview, type));
ListView list = getListView();
list.setTextFilterEnabled(true);
list.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
}
});
}
静态最终字符串 [] 类型 = 新字符串 []{
"Array", "Operator Overloading", "Inheritence", "Strings", "Pointers", "Files", "Misclaneous"
};
}