本文整理汇总了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);
}
}