开发者

notifyDataSetChanged() doesn't update ListView

protected void onActivityResult(int requestCod开发者_如何学JAVAe, int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            deserializeQuotes();
            quotesAdapter.notifyDataSetChanged();
        }
    }

My array clearly has been updated, and I can see the change when my app starts, but why doesn't it update in this method? The code enters this method.


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

Works, but why do I have to create a new adapter? Why can't I use my existing one?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜