字體:小 中 大 | |
|
|
2017/03/24 18:09:08瀏覽43|回應0|推薦0 | |
ListView
String[] str_ary1;
ArrayAdapter str_ary_adpt1r = new ArrayAdapter (this,
simple_list_item_1,
str_ary1);
ListView lv1 = ()getViewById();
lv1.setAdapter(str_ary_adpt1);
//-----
ArrayAdapter str_ary_adpt1r = new ArrayAdapter (this, simple_list_item_1);
str_ary_adpt1r.add("string1");
str_ary_adpt1r.add("string2");
//-----
lv1.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
ListView lv2 = (ListView)arg0;
Log.i("greatcat",Integer.toString(arg2)+" "+lv2.getItemIdAtPosition(arg2));
}
});
|
|
( 心情隨筆|心情日記 ) |