3 回答
TA贡献1878条经验 获得超4个赞
ArrayList
adding the itemsnotifyDataSetChanged()
TA贡献2021条经验 获得超8个赞
@Override
public Void loadInBackground() {
Log.v(TAG, "Init loadings contacts");
synchronized (SingleTonProvider.getInstance()) {
PhoneBookManager.preparePhoneBookContacts(getContext());
}
}@Overridepublic Loader<PhoneBookContactAdapter> onCreateLoader(int arg0, Bundle arg1) {
return new PhoneBookContactLoader(this);}@Overridepublic void onLoadFinished(Loader<PhoneBookContactAdapter>
arg0, PhoneBookContactAdapter arg1) {
contactList.setAdapter(adapter = arg1);}/*
* AsyncLoader to load phonebook and notify the list once done.
*/private static class PhoneBookContactLoader extends AsyncTaskLoader<PhoneBookContactAdapter> {
private PhoneBookContactAdapter adapter;
public PhoneBookContactLoader(Context context) {
super(context);
}
@Override
public PhoneBookContactAdapter loadInBackground() {
synchronized (SingleTonProvider.getInstance()) {
return adapter = new PhoneBookContactAdapter(getContext());
}
}}添加回答
举报
