先列出code:(直接copy过来的)
public class MySimpleAdapterActivity extends Activity {
private ListView simpleAdapterlistview;
public String[] strings;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_adapter_main);
simpleAdapterlistview = (ListView)findViewById(R.id.simpleAdapterlistview);
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
for (int j = 0; j < 5; j++) {
Map<String,String> myMap = new HashMap<String, String>();
myMap.put("1", "yang "+Integer.toString(j));
list.add(myMap);
}