2010-09-26 87 views

回答

2

是的。例如:

public class StoreListActivity extends Activity { 
    private List<Store> mStores; 
    private StoreAdapter mStoreAdapter; 
    private ListView mListView; 

    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.store_list); 
     mListView = (ListView) findViewById(R.id.store_listview); 

      mStores = getTheStoresFromSomewhere(); 
     mStoreAdapter = new StoreAdapter(this, mStores); 
     mListView.setAdapter(mStoreAdapter); 
    } 
+0

阵列适配器可以一样使用吗? – Mitchell 2010-09-26 13:39:30

+0

@Mitchell:是的。 – CommonsWare 2010-09-26 13:43:33

+0

:D明白了。感谢大家!虽然我可能会有另一个问题,我会稍后发布。 – Mitchell 2010-09-26 13:45:20