Best code examples for Fragment onActivityCreated method (android.app.Fragment.onActivityCreated)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment onActivityCreated method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Fragment onActivityCreated examples from Open Source projects
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(); 
  } 
Full Snippet Info
8
CodeRank
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
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);
		} 
	} 
 
} 
Full Snippet Info
10
CodeRank
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);
    } 
  } 
   
Full Snippet Info
7
CodeRank
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();
            } 
        } 
Full Snippet Info
7
CodeRank
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: