Android DataSetObserver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android DataSetObserver class.

This code example shows how to use the following methods:onChanged
            mDataSetObserver = dataSetObserver;
        } 
 
        @Override 
        public void onChanged() { 
            mDataSetObserver.onChanged();
            if (mCallback != null) {
                mCallback.onChanged();
            } 
        } 
 
        @Override 
        public void onInvalidated() { 
            mDataSetObserver.onInvalidated();
            if (mCallback != null) {
                mCallback.onInvalidated();
            } 
        } 
    } 
 
5
CodeRank
This code example shows how to use the following methods:onChanged
		instances = prefs.getAllConfiguredInstances();
		notifyDataSetChanged(); 
	} 
 
	private void notifyDataSetChanged() { 
		observer.onChanged();
	} 
 
} 
3
CodeRank
This code example shows how to use the following methods:onChanged
 
        private DataSetObserver lastDataSetObserver;
 
        public void notifyDataSetChanged() { 
            if (lastDataSetObserver != null) {
                lastDataSetObserver.onChanged();
            } 
        } 
 
        @Override 
        public void registerDataSetObserver(DataSetObserver dataSetObserver) {
            wrapped.registerDataSetObserver(lastDataSetObserver = dataSetObserver);
        } 
 
        @Override 
        public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
            lastDataSetObserver = null;
            wrapped.unregisterDataSetObserver(dataSetObserver);
        } 
 
3
CodeRank
This code example shows how to use the following methods:onChanged
 
	public void setData(Collection<JSONObject> data) {
		this.data.clear();
		this.data.addAll(data);
		if (observer != null) {
			observer.onChanged();
		} 
		tags.clear();
		for (JSONObject obj : data) {
			JSONArray arr = obj.optJSONArray("tags");
			if (arr != null) {
				for (int i = 0; i < arr.length(); i++) {
					String tag = arr.optString(i).toLowerCase();
					if (tags.indexOf(tag) == -1) {
						tags.add(tag);
					} 
				} 
			} 
		} 
		Collections.sort(tags);
4
CodeRank
This code example shows how to use the following methods:onChanged
	public void setData(Collection<JSONObject> data) {
		this.data.clear();
		this.data.addAll(data);
		unsent = controller.getUnsentCheckins();
		if (null != observer) {
			observer.onChanged();
		} 
	} 
 
	@Override 
	public boolean areAllItemsEnabled() { 
		return true; 
	} 
 
	@Override 
	public JSONObject getChild(int groupPosition, int childPosition) {
		JSONObject checkin = data.get(groupPosition);
		JSONArray refs = checkin.optJSONArray("refs");
		if (childPosition < refs.length()) {
			return refs.optJSONObject(childPosition);
4
CodeRank
This code example shows how to use the following methods:onChanged
		mShowProgress = showProgress;
	} 
 
	public void setCursor(Cursor cursor) {
		mCursor = cursor;
		mDataSetObserver.onChanged();
	} 
 
	public boolean hasCursor() { 
		return mCursor != null;
	} 
 
	protected boolean loadInProgress() { 
		return !hasCursor(); 
	} 
 
	protected View getProgressView(View convertView, ViewGroup parent) {
		if (convertView != null) {
			return convertView;
		} else { 
4
CodeRank
This code example shows how to use the following methods:onChanged
	private String m_opts[] = null;
	protected static int back_color = 0xFFFFFFC0;
	public void set_opts( String[] opts )
	{ 
		m_opts = opts;
		m_obs.onChanged();
	} 
	public int getCount() 
	{ 
		if( m_opts == null ) return 0;
		return m_opts.length;
	} 
 
	public Object getItem(int arg0)
	{ 
		return m_opts[arg0];
	} 
 
	public long getItemId(int position)
	{ 
4
CodeRank
This code example shows how to use the following methods:onChanged
	} 
	 
	public void finishRetrieval() { 
		retrievalFinished = true;
		if(dataSetObserver != null)
			dataSetObserver.onChanged();
	} 
 
	@Override 
    public void addRow(Object[] columnValues) {
	    super.addRow(columnValues);
	     
	    if(dataSetObserver != null)
	    	dataSetObserver.onChanged();
    } 
 
	@Override 
    public void registerDataSetObserver(DataSetObserver observer) {
	    dataSetObserver = observer;
	    super.registerDataSetObserver(observer);
4
CodeRank
This code example shows how to use the following methods:onChanged
    } 
     
    public void fetchTweets() { 
    	mentions = d.getMentions();
		if(observedby != null) {
			observedby.onChanged();
		}		 
		ThumbnailAdapter ta = ((Timeline)owner).getMentionsTA();
		if(ta != null) ta.notifyDataSetChanged();
    } 
     
    private DBStatus getStatus(long status_id) {
    	if(statusCache.containsKey(status_id)) {
    		return statusCache.get(status_id);
    	} 
     	DBStatus dbs = d.getStatus(status_id);
     	if(dbs != null) {
     		statusCache.put(status_id, dbs);
     	} 
        return dbs;
4
CodeRank
This code example shows how to use the following methods:onChanged
 
	@Override 
	public void onChanged() { 
		final DataSetObserver o = mObserver.get();
		if (o != null) {
			o.onChanged();
		} else { 
			mAdapter.unregisterDataSetObserver(this);
		} 
	} 
 
	@Override 
	public void onInvalidated() { 
		final DataSetObserver o = mObserver.get();
		if (o != null) {
			o.onInvalidated();
		} else { 
			mAdapter.unregisterDataSetObserver(this);
		} 
	} 
4
CodeRank

Related Android DataSetObserver Questions & Answers:

See Code Examples for Android DataSetObserver Methods: