2010-09-26 93 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