ArrayAdapter参数的不同运用

ArrayAdapter参数不同带来的效果不同

String[] array = {"a","b","c","d","e","f","g"}; 
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
android.R.layout.simple_list_item_1, array); 

 

这种使用不能动态添加

 

String[] array = {"a","b","c","d","e","f","g"};  
ArrayList<String> lst = new ArrayList<String>(); 
lst.addAll(Arrays.asList(array)); 
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,  
android.R.layout.simple_list_item_1, lst);  
可以

posted @ 2014-10-08 11:28  新感觉  阅读(2708)  评论(1编辑  收藏  举报