Android SimpleCursorAdapter - 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 SimpleCursorAdapter class.

This code example shows how to use the following methods: swapCursor, notifyDataSetChanged, notifyDataSetInvalidated
    } 
 
    private void setIndeterminateLoading(boolean isLoading) {
        if (isLoading != mShowIndeterminate) {
            mShowIndeterminate = isLoading;
            notifyDataSetInvalidated();
            notifyDataSetChanged();
        } 
    } 
 
    @Override 
    public int getCount() { 
        if (mShowIndeterminate) {
            return 1; 
        } else { 
            return super.getCount(); 
        } 
    } 
 
    @Override 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
import static android.support.v4.app.Watson.OnCreateOptionsMenuListener; 
import static android.support.v4.app.Watson.OnOptionsItemSelectedListener; 
import static android.support.v4.app.Watson.OnPrepareOptionsMenuListener; 
 
public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
    private SherlockFragmentActivity mActivity;
 
    public SherlockFragmentActivity getSherlockActivity() { 
        return mActivity;
    } 
 
    @Override 
    public void onAttach(Activity activity) {
        if (!(activity instanceof SherlockFragmentActivity)) {
            throw new IllegalStateException(getClass().getSimpleName() + " must be attached to a SherlockFragmentActivity.");
        } 
        mActivity = (SherlockFragmentActivity)activity;
 
        super.onAttach(activity);
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setRetainInstance
	 
	public ColorFragment() {  
		this(R.color.white);
	} 
	 
	public ColorFragment(int colorRes) {
		mColorRes = colorRes;
		setRetainInstance(true);
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		if (savedInstanceState != null)
			mColorRes = savedInstanceState.getInt("mColorRes");
		int color = getResources().getColor(mColorRes);
		// construct the RelativeLayout 
		RelativeLayout v = new RelativeLayout(getActivity());
		v.setBackgroundColor(color);		
		return v;
	} 
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
package com.newsblur.fragment; 
 
import android.os.Bundle; 
import android.support.v4.app.Fragment; 
import android.view.LayoutInflater; 
import android.view.View; 
import android.view.ViewGroup; 
 
import com.newsblur.R; 
 
public class LoadingFragment extends Fragment {
	 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		return inflater.inflate(R.layout.fragment_loadingitems, null);
	} 
 
} 

10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCursor
		} 
		super.bindView(view, context, cursor);
	} 
 
	public void closeCursor() { 
		final Cursor cursor = getCursor();
		if (cursor == null) return;
		if (!cursor.isClosed()) {
			cursor.close();
		} 
	} 
 
	@Override 
	public CharSequence convertToString(final Cursor cursor) {
		if (isCursorClosed()) return null; 
		return cursor.getString(mScreenNameIdx != -1 ? mScreenNameIdx : mNameIdx);
	} 
 
	public boolean isCursorClosed() { 
		final Cursor cursor = getCursor();
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Android SimpleCursorAdapter Methods: