我一直在努力使用一些教程将列表视图选项传递给新活动并将其作为标题(稍后我将使用它做其他事情)。我已经设置了一个 OnClickListener 最好放在里面
ListView listView1 = (ListView) findViewById(R.id.sportslist);
String[] items = { "Archery", "Badminton", "Cricket", "Dodgeball", "Equestrian", "Football", "Golf", "Handball", "Ice Hockey", "Ju Jitsu", "Karate", "Lacrosse", "Mountain Biking", "Netball" };
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);
listView1.setAdapter(adapter);
listView1.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id)
?????
}
});
谢谢
编辑:额外代码
final TextView changetitle = (TextView) findViewById(R.id.detailedsocietyname);
changetitle.setText(name);