2010-08-30 88 views
0
protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
     if (resultCode == RESULT_OK) { 
      deserializeQuotes(); 
      quotesAdapter.notifyDataSetChanged(); 
     } 
    } 

我的數組顯然已經更新,我可以在我的應用程序啓動時看到更改,但爲什麼不更新此方法?代碼輸入這個方法。notifyDataSetChanged()不更新ListView

回答

1
this.quotesAdapter = new QuoteAdapter(this, R.layout.mainrow, quotes);  
      quotesAdapter.notifyDataSetChanged(); 
      listView.setAdapter(quotesAdapter); 

工程,但爲什麼我必須創建一個新的適配器?爲什麼我不能使用現有的?

+0

我們需要更多的代碼。您可能會覆蓋某處引用的引用 – Falmarri 2010-08-30 22:49:01

相關問題