當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。