ListFragment setListShown - 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 setListShown method.

This code example shows how to use the following methods:setEmptyText, setListAdapter, setListShown, getActivity, getLoaderManager
 
        // Task we have running to populate the database. 
        AsyncTask<Void, Void, Void> mPopulatingTask;
 
        @Override public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);
 
            setEmptyText("No data.  Select 'Populate' to fill with data from Z to A at a rate of 4 per second.");
            setHasOptionsMenu(true);
 
            // Create an empty adapter we will use to display the loaded data. 
            mAdapter = new SimpleCursorAdapter(getActivity(),
                    android.R.layout.simple_list_item_1, null,
                    new String[] { MainTable.COLUMN_NAME_DATA },
                    new int[] { android.R.id.text1 }, 0);
            setListAdapter(mAdapter);
 
            // Start out with a progress indicator. 
            setListShown(false);
 

8
CodeRank
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setEmptyText, setListAdapter, setListShown, getActivity, getLoaderManager
 
        // If non-null, this is the current filter the user has provided. 
        String mCurFilter;
 
        @Override public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);
 
            // Give some text to display if there is no data.  In a real 
            // application this would come from a resource. 
            setEmptyText("No phone numbers");
 
            // We have a menu item to show in action bar. 
            setHasOptionsMenu(true);
 
            // Create an empty adapter we will use to display the loaded data. 
            mAdapter = new SimpleCursorAdapter(getActivity(),
                    android.R.layout.simple_list_item_2, null,
                    new String[] { Contacts.DISPLAY_NAME, Contacts.CONTACT_STATUS },
                    new int[] { android.R.id.text1, android.R.id.text2 }, 0);
            setListAdapter(mAdapter);

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setListAdapter, setListShown, getLoaderManager, onActivityCreated
        adapter = new ContentAdapter(getActivity());
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setListAdapter(adapter);
        setListShown(false);
        getLoaderManager().initLoader(0, null, this);
    } 
 
    @Override 
    public Loader<Cursor> onCreateLoader(int id, Bundle args) {
        Uri uri = Uri.parse(getArguments().getString(ARG_URI));
        return new CursorLoader(getActivity(), uri, null, null, null, null);
    } 
 
    @Override 
    public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
        adapter.swapCursor(cursor);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setListAdapter, setListShown, getLoaderManager, onActivityCreated
        return v;
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setListAdapter(controller.getAdapter());
        setListShown(false);
        getLoaderManager().initLoader(0, null, this);
    } 
 
    @Override 
    public Loader<Cursor> onCreateLoader(int id, Bundle args) {
        return controller.createLoader();
    } 
 
    @Override 
    public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
        controller.swapCursor(cursor);
        setEmptyText(getEmptyText(cursor));
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setEmptyText, setListShown, setListShownNoAnimation, isResumed
							"Report list Cursor size: %d. Cursor columns: %s. Cursor column count: %d", 
							cursor.getCount(),
							Arrays.toString(cursor.getColumnNames()),
							cursor.getCount()));
			mAdapter.swapCursor(cursor);
			if (isResumed()) {
				setListShown(true);
			} else { 
				setListShownNoAnimation(true);
			} 
		} 
		setEmptyText("No reports downloaded yet");
		setListShown(true);
		if (dialog.isShowing()) {
			dialog.dismiss();
		} 
	} 
 
	@Override 
	public void onLoaderReset(Loader<Cursor> arg0) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setEmptyText, setListAdapter, setListShown, getActivity, getLoaderManager
public class AppListFragment extends ListFragment implements LoaderManager.LoaderCallbacks<ArrayList<AppModel>> {
    AppListAdapter mAdapter;
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
 
        setEmptyText("No Applications");
 
        mAdapter = new AppListAdapter(getActivity());
        setListAdapter(mAdapter);
 
        // till the data is loaded display a spinner 
        setListShown(false);
 
        // create the loader to load the apps list in background 
        getLoaderManager().initLoader(0, null, this);
    } 
 
    @Override 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setEmptyText, setListAdapter, setListShown, getActivity, getArguments
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub 
		super.onActivityCreated(savedInstanceState);
 
		setEmptyText("Empty");
 
		setListShown(false);
 
		repairItemListAdapter = new RepairItemListAdapter(getActivity()
				.getBaseContext(), null);
		setListAdapter(repairItemListAdapter);
 
		getLoaderManager().initLoader(REPAIR_ITEM_LIST_LOADER, getArguments(),
				this);
	} 
 
	@Override 
	public void onViewCreated(View view, Bundle savedInstanceState) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setListAdapter, setListShown, getLoaderManager, onActivityCreated
        return v;
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        controller.setThingBodyWidth(getThingBodyWidth());
        setListAdapter(controller.getAdapter());
        setListShown(false);
        getLoaderManager().initLoader(0, null, this);
    } 
 
    @Override 
    public void refresh() { 
        controller.swapCursor(null);
        setListAdapter(controller.getAdapter());
        setListShown(false);
        getLoaderManager().restartLoader(0, null, this);
    } 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related ListFragment setListShown Questions & Answers:

setListShown Method Overview
Control whether the list is being displayed.
See Code Examples for other Android ListFragment Methods: