当前位置: 首页>>代码示例>>Java>>正文


Java CursorAdapter.swapCursor方法代码示例

本文整理汇总了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);
    }
 
开发者ID:casific,项目名称:murmur,代码行数:18,代码来源:StarredFragment.java

示例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);
    }
 
开发者ID:casific,项目名称:murmur,代码行数:18,代码来源:ContactsFragment.java

示例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));
    }
 
开发者ID:casific,项目名称:murmur,代码行数:19,代码来源:ExpandedMessageFragment.java

示例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);
    }
}
 
开发者ID:ultramega,项目名称:flavordex,代码行数:8,代码来源:AppImportDialog.java

示例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);
}
 
开发者ID:KeithYokoma,项目名称:LGTMCamera,代码行数:6,代码来源:ComposeHistoryViewHelper.java

示例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);
	}
}
 
开发者ID:baracudda,项目名称:androidBits,代码行数:7,代码来源:AppCursorLoader.java


注:本文中的android.widget.CursorAdapter.swapCursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。