Fragment getLoaderManager - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getLoaderManager, onCreate
		return view;
	} 
	 
	@Override 
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		getLoaderManager().initLoader(0, null, this);
	} 
	 
	@Override 
	public void onResume(){ 
		super.onResume(); 
		//getLoaderManager().restartLoader(0, null, this); 
	} 
	@Override 
	public void onPause(){ 
		super.onPause(); 
	} 
 
	public static TrendFragment newInstance() { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActivity, getLoaderManager, onActivityCreated
    public FenceDetailFragment() { 
        super(); 
    } 
 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        activity = getActivity();
        contentResolver = activity.getContentResolver();
 
        if (fenceUri != null) {
            getLoaderManager().initLoader(0, null, this);
        } else { 
            // New fence (set default values) 
            Location location = getLastLocationFinder(getActivity()).getLastBestLocation(0, 0);
            if (location != null) {
                nameEditText.setText("fence");
                latitudeEditText.setText(location.getLatitude() + "");
                longitudeEditText.setText(location.getLongitude() + "");
                radiusEditText.setText("500");
                typeRadioGroup.check(typeRadioGroup.getChildAt(0).getId());
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLoaderManager, onActivityCreated
		return view;
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
 
		Bundle loaderArgs = new Bundle();
		loaderArgs.putInt("showId", showId);
		getLoaderManager().initLoader(0, loaderArgs, this);
	} 
 
	@Override 
	public Loader<Cursor> onCreateLoader(int id, Bundle args) {
		int showId = args.getInt("showId");
		Uri uri = Uri.withAppendedPath(ShowsProvider.CONTENT_URI_SHOWS,
		                               new Integer(showId).toString());
		String[] projection = {
			ShowsTable.COLUMN_OVERVIEW, 
			ShowsTable.COLUMN_FIRST_AIRED 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActivity, getLoaderManager, onActivityCreated
        return v;
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
 
        mApplication = (SecretDiaryApplication) getActivity().getApplication();
 
        // Prepare the loader.  Either re-connect with an existing one, or start a new one. 
        getLoaderManager().initLoader(0, null, this);
    } 
 
    @Override 
    public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
        return null;  //To change body of implemented methods use File | Settings | File Templates. 
    } 
 
    @Override 
    public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLoaderManager, onActivityCreated
public class ContractionAverageFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor>
{ 
	@Override 
	public void onActivityCreated(final Bundle savedInstanceState)
	{ 
		super.onActivityCreated(savedInstanceState);
		getLoaderManager().initLoader(0, null, this);
	} 
 
	@Override 
	public Loader<Cursor> onCreateLoader(final int id, final Bundle args)
	{ 
		final String[] projection = { ContractionContract.Contractions.COLUMN_NAME_START_TIME,
				ContractionContract.Contractions.COLUMN_NAME_END_TIME }; 
		final String selection = ContractionContract.Contractions.COLUMN_NAME_START_TIME + ">?";
		final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
		final long averagesTimeFrame = Long.parseLong(preferences.getString(
				Preferences.AVERAGE_TIME_FRAME_PREFERENCE_KEY, 
				getString(R.string.pref_settings_average_time_frame_default)));
		final long timeCutoff = System.currentTimeMillis() - averagesTimeFrame;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getArguments, getLoaderManager, onCreate
		return f;
	} 
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		 
		Bundle args = getArguments();
		imageUrl = args.getString(EXTRA_IMAGE_URL);
		 
		getLoaderManager().initLoader(0, null, this);
	} 
	 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.fragment_image, container, false);
		 
		imageView = (TouchImageView) v.findViewById(R.id.image);
		 
		return v;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFragmentManager, getLoaderManager, onCreate
This code example shows how to use the following methods:getActivity, getLoaderManager, onCreateView
	 * paikkatietokannan tietueen id ja centering-koordinaattimuuttujiin sen  
	 * sijainti, keskitet��n kartta sen mukaan. 
	 */ 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		super.onCreateView(inflater, container, savedInstanceState);
		// Alustetaan overlay 
		final MainActivity main = (MainActivity) getActivity();
		mapView = main.getMapView();
		mapView.setBuiltInZoomControls(true);
		overlay = new LocationItemizedOverlay(new Triangle(MARKER_WIDTH, MARKER_HEIGHT, Color.RED), mapView.getContext(),
				getLoaderManager());
		if (specialId > -1) {
			overlay.setSpecial(specialId);
		} 
		mapView.getOverlays().add(overlay);
		overlay.setItemsChangedListener(new OverlayItemsChangedListener());
		centerIfNecessary(); 
		return mapView;
	} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLoaderManager, onActivityCreated
		mTimeFilter = new TimeFilter(getArguments());
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		getLoaderManager().initLoader(0, null, this);
	} 
 
	@Override 
	public void setCampaignUrn(String campaignUrn) {
		mCampaignSurveyFilter.setCampaignUrn(campaignUrn);
		getLoaderManager().restartLoader(0, null, this);
	} 
 
	@Override 
	public String getCampaignUrn() {
		return mCampaignSurveyFilter.getCampaignUrn();
	} 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLoaderManager
	public CommentAdapter(Fragment ctx, int loaderId, String objectId) {
		m_ctx       = ctx;
        m_objectId  = objectId;
        m_cursor    = null;
 
        LoaderManager lm = m_ctx.getLoaderManager();
        lm.initLoader(loaderId, null, this);
	} 
 
	 
	@Override 
	public int getCount() { 
		return m_cursor != null ? m_cursor.getCount() : 0;
	} 
 
	@Override 
	public JSONObject getItem(int idx) {
		Log.v(TAG, "getItem(" + idx + ")");
        try { 
            m_cursor.moveToPosition(idx);
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Fragment getLoaderManager Questions & Answers:

getLoaderManager Method Overview
Return the LoaderManager for this fragment, creating it if needed.
See Code Examples for other Android Fragment Methods: