Fragment onActivityCreated - 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 onActivityCreated method.

This code example shows how to use the following methods:getActivity, onActivityCreated, setRetainInstance
    return(result);
  } 
 
  @Override 
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
 
    setRetainInstance(true);
    getActivity().getApplicationContext()
                 .bindService(new Intent(
                                         "com.commonsware.android.advservice.IScript"), 
                              this, Context.BIND_AUTO_CREATE);
  } 
 
  @Override 
  public void onDestroy() { 
    getActivity().getApplicationContext().unbindService(this);
 
    super.onDestroy(); 
  } 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getActivity, getView, onActivityCreated
    /** 
     * Attach to list view once Fragment is ready to run. 
     */ 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        ensureList(); 
    } 
 
    /** 
     * Detach from list view. 
     */ 
    @Override 
    public void onDestroyView() { 
        mHandler.removeCallbacks(mRequestFocus);
        mList = null;
        super.onDestroyView(); 
    } 
 
    /** 

9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getActivity, onActivityCreated, startActivity
		return inflater.inflate(R.layout.splash, container, false);
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		/* Found credentials, forwarding to BrowsingActivity */ 
		SharedPreferences prefs = SettingsActivity.getSettings(getActivity());
		if (prefs.contains("ident")) {
			Intent browseData = new Intent(getActivity(), BrowsingActivity.class);
			String serverUrl = prefs.getString("serverUrl", "");
			browseData.putExtra("url", serverUrl + "/api/getFolderList");
			startActivity(browseData);
		} 
	} 
 
} 
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityCreated
    return(inflater.inflate(R.layout.content_fragment, container, false));
  } 
   
  @Override 
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
     
    WebView browser=getBrowser();
     
    browser.setWebViewClient(new RedirectFixer());
    browser.getSettings().setJavaScriptEnabled(true);
     
    if (savedInstanceState!=null) {
      browser.restoreState(savedInstanceState);
    } 
    else if (urlToLoad!=null) {
      loadUrl(urlToLoad);
    } 
  } 
   
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getFragmentManager, onActivityCreated
            return v;
        } 
 
        @Override 
        public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);
 
            FragmentManager fm = getFragmentManager();
 
            // Check to see if we have retained the worker fragment. 
            mWorkFragment = (RetainedFragment)fm.findFragmentByTag("work");
 
            // If not retained (or first time running), we need to create it. 
            if (mWorkFragment == null) {
                mWorkFragment = new RetainedFragment();
                // Tell it who it is working with. 
                mWorkFragment.setTargetFragment(this, 0);
                fm.beginTransaction().add(mWorkFragment, "work").commit();
            } 
        } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityCreated
    Log.d(getClass().getSimpleName(), "onCreate()");
  } 
   
  @Override 
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Log.d(getClass().getSimpleName(), "onActivityCreated()");
  } 
 
  @Override 
  public void onStart() { 
    super.onStart(); 
    Log.d(getClass().getSimpleName(), "onStart()");
  } 
 
  @Override 
  public void onResume() { 
    super.onResume(); 
    Log.d(getClass().getSimpleName(), "onResume()");
  } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getActivity, onActivityCreated
        return v;
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
 
        // Use the parent activity to load the image asynchronously into the ImageView (so a single 
        // cache can be used over all pages in the ViewPager 
        if (ImageDetailActivity.class.isInstance(getActivity())) {
            mImageFetcher = ((ImageDetailActivity) getActivity()).getImageFetcher();
            mImageFetcher.loadImage(mImageUrl, mImageView);
        } 
 
        // Pass clicks on the ImageView to the parent activity to handle 
        if (OnClickListener.class.isInstance(getActivity()) && Utils.hasHoneycomb()) {
            mImageView.setOnClickListener((OnClickListener) getActivity());
        } 
    } 
 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityCreated
		return v;
	} 
 
	@Override 
	public void onActivityCreated(Bundle saved) {
		super.onActivityCreated(saved);
		Log.i(TAG, "onActivityCreated");
	} 
 
	@Override 
	public void onStart() { 
		super.onStart(); 
		Log.i(TAG, "onStart");
	} 
 
	@Override 
	public void onResume() { 
		super.onResume(); 
		Log.i(TAG, "onResume");
	} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityCreated
     * @param savedInstanceState saved {@link Fragment} state before the {@link Fragment} destroyed. 
     */ 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        Log.v(TAG, "onActivityCreated");
        super.onActivityCreated(savedInstanceState);
    } 
 
    /** 
     * <blockquote> 
     * onStart() 以後、{@link Fragment} はユーザに見える状態にになります。 
     * </blockquote> 
     * 
     * <blockquote> 
     * onStart() makes the {@link Fragment} visible to the user 
     * (based on its containing {@link Activity} being started). 
     * </blockquote> 
     */ 
    @Override 
    public void onStart() { 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityCreated
			new LoadLegislatorTask(this).execute(context.bioguide_id);
	} 
	 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		 
		if (this.legislator != null)
			context.onLoadLegislator(legislator);
		else if (this.exception != null)
			context.onLoadLegislator(this.exception);
	} 
	 
	public LegislatorLoaderFragment() {} 
	 
	// pass through 
	public void onLoadLegislator(Legislator legislator) {
		this.legislator = legislator;
		context.onLoadLegislator(legislator);
	} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
onActivityCreated Method Overview
Called when the fragment's activity has been created and this fragment's view hierarchy instantiated.
See Code Examples for other Android Fragment Methods: