My ListView is as follows:
Name Student ID achievements
aaa 111 99
bbb 222 95
data types are String type, ListView data through SimpleAdapter bound to above.
What I want to get learn how to change numbers and results obtained it?
------ Solution ---------------------------------------- ----
get to click on the line, and then what you put inside listView data, then how to remove it.
------ Solution ---------------------------------------- ----
can do a data corresponding pojo class set out as Student.java name, student number, the achievement of the private property set, get, override toString method
public class ListViewTest extends Activity {
private ListView lv;
private List
stus;
@ Override
protected void onCreate (Bundle savedInstanceState) {
/ / TODO Auto-generated method stub
super.onCreate (savedInstanceState);
stus = new ArrayList ();
stus.add (new Student (1001, "zhangsan", 20,85));
stus.add (new Student (1002, "lisi", 21,87.5));
stus.add (new Student (1003, "wangwu", 22,88));
stus.add (new Student (1004, "zhaoliu", 20,75));
stus.add (new Student (1005, "qianqi", 21,97.5));
stus.add (new Student (1006, "liuba", 22,68));
setContentView (R.layout.list_view_test);
lv = (ListView) findViewById (R.id.list_view_01);
List
没有评论:
发表评论