ListFragment getListView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ListFragment getListView method.

This code example shows how to use the following methods:getListView, getActivity, getArguments, getFragmentManager
	public static int[] color = {Color.BLUE,Color.GRAY,Color.CYAN,Color.RED,Color.GREEN,Color.YELLOW,Color.GRAY,Color.CYAN,Color.RED,Color.BLUE,Color.GRAY};
	public static int numberOfCardOnDeck;
	 
	 
 
	public DataViewFragment() { 
 
	} 
 
	/** 
	 * Create a new instance of DetailsFragment. 
	 */ 
	public static DataViewFragment newInstance(int index, int previousFragmentId) {
		DataViewFragment f = new DataViewFragment();
		// Supply index input as an argument. 
		Bundle args = new Bundle();
		args.putInt("index", index);
		args.putInt("prevFragmentId", previousFragmentId);
		f.setArguments(args);
		args = null;

9
CodeRank
This code example shows how to use the following methods:getListView
  } 
   
  @Override 
  public void onSaveInstanceState(Bundle state) {
    state.putInt(STATE_CHECKED,
                  getListView().getCheckedItemPosition());
  } 
   
  protected void restoreState(Bundle state) {
    if (state!=null) {
      int position=state.getInt(STATE_CHECKED, -1);
       
      if (position>-1) {
        getListView().setItemChecked(position, true);
      } 
    } 
  } 
   
  public void enablePersistentSelection() { 
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
6
CodeRank
This code example shows how to use the following methods:getListView, setEmptyText, setListShown, getActivity, getLoaderManager
		// getLoaderManager().initLoader(0, null, this); 
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		/* Cursor Loader */ 
		setEmptyText("No indicators found");
 
		// myAdapter = new AreaCursorAdapter(); 
 
		// setListAdapter(mAdapter); 
		setListShown(false);
		getLoaderManager().initLoader(0, null, this);
 
		try { // Check if the parent activity is the IndicatorActivity 
			hAct = (HomeActivity) getActivity();
			myAdapter.setSelectedPosition(-1, getListView());
		} catch (ClassCastException actException) {
			act = (IndicatorActivity) getActivity();

7
CodeRank
This code example shows how to use the following methods:getListView, onActivityCreated
		return mReachedBottom;
	} 
 
	@Override 
	public void onActivityCreated(final Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		mIsInstanceStateSaved = savedInstanceState != null;
		final ListView lv = getListView();
		lv.setOnScrollListener(this);
	} 
 
	@Override 
	public void onAttach(final Activity activity) {
		super.onAttach(activity);
	} 
 
	@Override 
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mActivityFirstCreated = true;
7
CodeRank
This code example shows how to use the following methods:getListView, setListAdapter, getActivity, onActivityCreated
 
public class MenuFragment extends ListFragment {
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		setListAdapter(new ArrayAdapter<String>(getActivity(),
				android.R.layout.simple_list_item_1, new String[] { " First", " Second", " Third", " Fourth", " Fifth", " Sixth"}));
		getListView().setCacheColorHint(0);
	} 
 
	@Override 
	public void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		((MenuActivity)getActivity()).getSlideoutHelper().close();
	} 
 
	 
} 
9
CodeRank
This code example shows how to use the following methods:getListView, onViewCreated, setListShown
        mPreferenceManager = onCreatePreferenceManager();    
    } 
     
    @Override 
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
 
		lv = getListView();
        lv.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);                	
        setListShown(true);
 
        PreferenceScreen screen = createPreferenceHierarchy(mPreferenceManager);
        if (screen != null) setPreferenceScreen(screen);
        postBindPreferences(); 
         
    	//((OnPreferenceAttachedListener)getActivity()).onPreferenceAttached(getPreferenceScreen(), 0); 
	} 
     
	protected abstract PreferenceScreen createPreferenceHierarchy(PreferenceManager prefMan);
 
7
CodeRank
This code example shows how to use the following methods:getListView, onResume
     */ 
    private int savedTopMostElementPosition;
 
    @Override 
    public void onResume() { 
        super.onResume(); 
        restoreScrollPosition(); 
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ScrollView scroller = new ScrollView(getActivity());
        TextView text = new TextView(getActivity());
        int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getActivity()
                .getResources().getDisplayMetrics());
        text.setPadding(padding, padding, padding, padding);
        scroller.addView(text);
        /* 
         * Sets the list of MovieInfo beans to a MovieListAdapter, which is then 

6
CodeRank
This code example shows how to use the following methods:getListView, getActivity, onActivityCreated
		BusProvider.getInstance().unregister(this);
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		 
		savedSearchView = (SavedSearchListView) getListView();
		savedSearchView.setDivider(null);
		savedSearchAdapter = new SavedResultCursorAdapter(getActivity(), DDGApplication.getDB().getCursorSavedSearch());
		savedSearchView.setAdapter(savedSearchAdapter);
	} 
 
	@Override 
	public void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		 
		Object adapter = getListView().getAdapter();
		Cursor c = null;
		 
6
CodeRank
This code example shows how to use the following methods:getListView, setListAdapter, onStart
        super(); 
    } 
 
    @Override 
    public void onStart() { 
        super.onStart(); 
        setListAdapter(mListAdapter);
        getListView().setOnItemClickListener(this);
        loadCategory(0); 
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mListAdapter = new ArrayAdapter<String>(getActivity(), R.layout.headline_item,
                mHeadlinesList);
    } 
 
    /** 
     * Sets the listener that should be notified of headline selection events. 
6
CodeRank
This code example shows how to use the following methods:getListView, setListAdapter, getActivity, getArguments, getLoaderManager
 
	SimpleCursorAdapter mAdapter;
	 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
	    super.onActivityCreated(savedInstanceState);
	     
	    Bundle args = getArguments();
	     
	    // ñîçäàåì àäàïòåð è íàñòðàèâàåì ñïèñîê 
	    mAdapter = new SimpleCursorAdapter(
	    		getActivity(), 
	    		args.getInt(ARG_ITEM_RESID), 
	    		null,  
	    		args.getStringArray(ARG_FROM_COLUMNS), 
	    		args.getIntArray(ARG_TO_FIELDS), 
	    		Adapter.NO_SELECTION
	    ); 
	    setListAdapter(mAdapter);	    
	     

6
CodeRank
getListView Method Overview
Get the activity's list view widget.
See Code Examples for other Android ListFragment Methods: