onCreateLoader創(chuàng)建了一個(gè)CursorLoader,該Loader回執(zhí)行ContentProvider的操作,然后返回一個(gè)cursor; onLoaderReset時(shí),將Adapter中的cursor置null; onLoadFinished時(shí),由于CursorLoader查詢完數(shù)據(jù),會(huì)返回新的cursor,我們使用新的Cursor去替換之前Adapter中的cursor。 這樣,我們就可以在Activity啟動(dòng)時(shí)自動(dòng)異步加載數(shù)據(jù)了,手機(jī)上試試,可...
www.dbjr.com.cn/article/1318...htm 2025-5-15