本文整理匯總了Java中android.widget.CursorAdapter.swapCursor方法的典型用法代碼示例。如果您正苦於以下問題:Java CursorAdapter.swapCursor方法的具體用法?Java CursorAdapter.swapCursor怎麽用?Java CursorAdapter.swapCursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.CursorAdapter
的用法示例。
在下文中一共展示了CursorAdapter.swapCursor方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: swapCursor
import android.widget.CursorAdapter; //導入方法依賴的package包/類
private void swapCursor(){
int offsetFromTop = 0;
int firstVisiblePosition = Math.max(0, feedListView.getFirstVisiblePosition());
if(feedListView.getChildCount() > 0) {
offsetFromTop = feedListView.getChildAt(0).getTop();
}
CursorAdapter newAdapter = ((CursorAdapter) feedListView.getAdapter());
newAdapter.swapCursor(getCursor());
if(SearchHelper.searchToSQL(query) == null) {
((FeedAdapter) newAdapter).setHighlight(Utils.getKeywords(query));
}
feedListView.setAdapter(newAdapter);
feedListView.setSelectionFromTop(firstVisiblePosition, offsetFromTop);
}
示例2: swapCursor
import android.widget.CursorAdapter; //導入方法依賴的package包/類
private void swapCursor(){
int offsetFromTop = 0;
int firstVisiblePosition = Math.max(0, contactListView.getFirstVisiblePosition());
if(contactListView.getChildCount() > 0) {
offsetFromTop = contactListView.getChildAt(0).getTop();
}
CursorAdapter newAdapter = ((CursorAdapter) contactListView.getAdapter());
newAdapter.swapCursor(getCursor());
if(SearchHelper.searchToSQL(query) == null) {
((ContactAdapter) newAdapter).setHighlight(Utils.getKeywords(query));
}
contactListView.setAdapter(newAdapter);
contactListView.setSelectionFromTop(firstVisiblePosition, offsetFromTop);
}
示例3: swapCursor
import android.widget.CursorAdapter; //導入方法依賴的package包/類
private void swapCursor(){
int offsetFromTop = 0;
int firstVisiblePosition = Math.max(0, listView.getFirstVisiblePosition());
if(listView.getChildCount() > 0) {
offsetFromTop = listView.getChildAt(0).getTop();
}
CursorAdapter newAdapter = ((CursorAdapter) listView.getAdapter());
newAdapter.swapCursor(getCursor());
if(SearchHelper.searchToSQL(query) == null) {
((FeedReplyAdapter) newAdapter).setHighlight(Utils.getKeywords(query));
}
listView.setAdapter(newAdapter);
listView.setSelectionFromTop(firstVisiblePosition, offsetFromTop);
parentMessage.setAdapter(new FeedAdapter(getActivity(), MessageStore.getInstance(getActivity()).getMessageById(messageId), false, feedAdapterCallbacks));
}
示例4: onLoaderReset
import android.widget.CursorAdapter; //導入方法依賴的package包/類
@Override
public void onLoaderReset(Loader<Cursor> loader) {
final CursorAdapter adapter = (CursorAdapter)getListAdapter();
if(adapter != null) {
adapter.swapCursor(null);
}
}
示例5: swapCursor
import android.widget.CursorAdapter; //導入方法依賴的package包/類
public void swapCursor(Cursor cursor) {
ListView listView = findViewById(R.id.list_history);
CursorAdapter adapter = (CursorAdapter) listView.getAdapter();
adapter.swapCursor(cursor);
}
示例6: swapAdapterCursor
import android.widget.CursorAdapter; //導入方法依賴的package包/類
protected void swapAdapterCursor(int aAdapterId, Cursor aCursor) {
CursorAdapter theAdapter = mAdapterMap.get(aAdapterId).get();
if (theAdapter!=null) {
theAdapter.swapCursor(aCursor);
}
}