當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleCursorAdapter.notifyDataSetChanged方法代碼示例

本文整理匯總了Java中android.support.v4.widget.SimpleCursorAdapter.notifyDataSetChanged方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleCursorAdapter.notifyDataSetChanged方法的具體用法?Java SimpleCursorAdapter.notifyDataSetChanged怎麽用?Java SimpleCursorAdapter.notifyDataSetChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.widget.SimpleCursorAdapter的用法示例。


在下文中一共展示了SimpleCursorAdapter.notifyDataSetChanged方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: populateList

import android.support.v4.widget.SimpleCursorAdapter; //導入方法依賴的package包/類
private void populateList() {

		String[] from = null;
		if (isFav) {
			from = new String[] { Beans.Favorite.COL_TITLE };
		} else {
			from = new String[] { Beans.Category.COL_NAME };
		} //check if fav or list
		int[] to = { R.id.list_item_text };
		int layoutId = R.layout.list_item;
		if (Preferences.getInstance(getActivity()).isRTL())
			layoutId = R.layout.list_item_right;
		
		getLoaderManager().initLoader(1, null, this);
		adapter = new SimpleCursorAdapter(getActivity(), layoutId, null, from,
				to, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
		adapter.setViewBinder(new Binder());
		setListAdapter(adapter);
		adapter.notifyDataSetChanged();
	}
 
開發者ID:Barqawiz,項目名稱:Android_ApplicationTemplate,代碼行數:21,代碼來源:ListFrag.java

示例2: applySuggestionCursor

import android.support.v4.widget.SimpleCursorAdapter; //導入方法依賴的package包/類
/**
 * Set the suggestion cursor to an Adapter then set it to the search view
 */
private void applySuggestionCursor() {
  final String[] cols = { COLUMN_NAME_ADDRESS};
  final int[] to = {R.id.suggestion_item_address};
  final SimpleCursorAdapter mSuggestionAdapter = new SimpleCursorAdapter(getActivity().getApplicationContext(),
      R.layout.search_suggestion_item, mSuggestionCursor, cols, to, 0);
  mSearchview.setSuggestionsAdapter(mSuggestionAdapter);
  mSuggestionAdapter.notifyDataSetChanged();
}
 
開發者ID:Esri,項目名稱:mapbook-android,代碼行數:12,代碼來源:MapFragment.java

示例3: prepareSearchSuggestions

import android.support.v4.widget.SimpleCursorAdapter; //導入方法依賴的package包/類
@Override
public void prepareSearchSuggestions(List<DrawerItemCategory> navigation) {
    final String[] from = new String[]{"categories"};
    final int[] to = new int[]{android.R.id.text1};

    searchSuggestionsAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1,
            null, from, to, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
    if (navigation != null && !navigation.isEmpty()) {
        for (int i = 0; i < navigation.size(); i++) {
            if (!searchSuggestionsList.contains(navigation.get(i).getName())) {
                searchSuggestionsList.add(navigation.get(i).getName());
            }

            if (navigation.get(i).hasChildren()) {
                for (int j = 0; j < navigation.get(i).getChildren().size(); j++) {
                    if (!searchSuggestionsList.contains(navigation.get(i).getChildren().get(j).getName())) {
                        searchSuggestionsList.add(navigation.get(i).getChildren().get(j).getName());
                    }
                }
            }
        }
        searchSuggestionsAdapter.notifyDataSetChanged();
    } else {
        Timber.e("Search suggestions loading failed.");
        searchSuggestionsAdapter = null;
    }
}
 
開發者ID:openshopio,項目名稱:openshop.io-android,代碼行數:28,代碼來源:MainActivity.java

示例4: setupAdapter

import android.support.v4.widget.SimpleCursorAdapter; //導入方法依賴的package包/類
private void setupAdapter(){
    final int views[] = { R.id.listing_title, R.id.listing_address, R.id.listing_city };
    final Cursor cursor;
    String[] fields;
    if (mIsSearchQuery) {
        fields = new String[]{ SearchTable.COLUMN_NAME, SearchTable.COLUMN_STREET, SearchTable.COLUMN_CITY };
        cursor = getActivity().getContentResolver().query(YellowContentProvider.CONTENT_URI_SEARCH_LISTINGS, SearchTableHelper.searchTableAdapterProjection, null, null, null);
    } else {
        fields = new String[]{ ListingsTable.COLUMN_NAME, ListingsTable.COLUMN_STREET, ListingsTable.COLUMN_CITY };
        cursor = getActivity().getContentResolver().query(YellowContentProvider.CONTENT_URI_LISTINGS, ListingsTableHelper.listingsTableAdapterProjection, null, null, null);
    }
    SimpleCursorAdapter adapter = new SimpleCursorAdapter(getActivity(), R.layout.row_listview, cursor, fields, views, 0);
    mListView.setAdapter(adapter);
    adapter.notifyDataSetChanged();
}
 
開發者ID:christhetree,項目名稱:Android_Yellow_Pages_App_Content_Provider,代碼行數:16,代碼來源:ListFragment.java

示例5: populateList

import android.support.v4.widget.SimpleCursorAdapter; //導入方法依賴的package包/類
public void populateList() {
	
	String[] from = new String[] { DBAdapter.KEEP_TABLE.COL_DATA, DBAdapter.KEEP_TABLE.COL_COLOR };
	int[] to = new int[] { R.id.textView1, R.id.item_color};
	
	getLoaderManager().initLoader(1, null, this);
	adapter = new SimpleCursorAdapter(getActivity(), R.layout.keep_item, null, from, to, 
					CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
	adapter.setViewBinder(new Binder());
	setListAdapter(adapter);
	adapter.notifyDataSetChanged();
	
	
}
 
開發者ID:Barqawiz,項目名稱:Database_Sqlite_Assets_Helper,代碼行數:15,代碼來源:KeepFragment.java


注:本文中的android.support.v4.widget.SimpleCursorAdapter.notifyDataSetChanged方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。