文件名称:ListDemo
介绍说明--下载内容均来自于网络,请自行研究使用
下拉列表范例
1存储数据的数组
2通过ID获取ListView对象
3构造适配器
4向ListView添加适配器
-ListDemo of Android
// String data[]=new String[]{"a","b","c"}
// ListView listView=(ListView)this.findViewById(R.id.listview)
// ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data)
// listView.setAdapter(arrayAdapter)
listView.setSelection(1)
}
}
1存储数据的数组
2通过ID获取ListView对象
3构造适配器
4向ListView添加适配器
-ListDemo of Android
// String data[]=new String[]{"a","b","c"}
// ListView listView=(ListView)this.findViewById(R.id.listview)
// ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data)
// listView.setAdapter(arrayAdapter)
listView.setSelection(1)
}
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ListDemo\.classpath
........\.project
........\AndroidManifest.xml
........\bin\classes.dex
........\...\ListDemo.apk
........\...\resources.ap_
........\...\sgit\ListDemo\ListDemo.class
........\...\....\........\R$attr.class
........\...\....\........\R$drawable.class
........\...\....\........\R$id.class
........\...\....\........\R$layout.class
........\...\....\........\R$string.class
........\...\....\........\R.class
........\default.properties
........\gen\sgit\ListDemo\R.java
........\res\drawable-hdpi\icon.png
........\...\.........ldpi\icon.png
........\...\.........mdpi\icon.png
........\...\layout\main.xml
........\...\values\strings.xml
........\src\sgit\ListDemo\ListDemo.java
........\bin\sgit\ListDemo
........\gen\sgit\ListDemo
........\src\sgit\ListDemo
........\bin\sgit
........\gen\sgit
........\res\drawable-hdpi
........\...\drawable-ldpi
........\...\drawable-mdpi
........\...\layout
........\...\values
........\src\sgit
........\assets
........\bin
........\gen
........\res
........\src
ListDemo