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

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
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getArguments, getFragmentManager, isAdded
            // the view hierarchy; it would just never be used. 
            return null; 
        } 
 
        if (getShownIndex() >= mQuickShare.getFeed().size()) {
            if (isAdded()) getFragmentManager().beginTransaction().remove(this).commit();
            return null; 
        } 
 
        Log.d(TAG, "[onCreateView]");
 
        View v = inflater.inflate(R.layout.story_detail_webview, container, false);
 
        Button mShareStory = (Button) v.findViewById(R.id.share_button);
        mShareStory.setOnClickListener(this);
 
        mWebView = (WebView) v.findViewById(R.id.story_webview);
 
        Log.d(TAG, "[onCreateView] url: loading the current story");
 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getActivity, getFragmentManager
    /** 
     * This method is called when login is finished. 
     * See {@link LoginCallback#onLoginCompleted(int, KiiUser, Exception)} 
     */ 
    void onLoginFinished() { 
        FragmentActivity activity = getActivity();
        if (activity == null) { return; }
        // store access token 
        KiiUser user = KiiUser.getCurrentUser();
        String token = user.getAccessToken();
        Pref.setStoredAccessToken(activity, token);
         
        ViewUtil.toNextFragment(getFragmentManager(), BalanceListFragment.newInstance(), false);
    } 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getFragmentManager, getLoaderManager, onCreate
This code example shows how to use the following methods: setMenuVisibility, setUserVisibleHint
//                    makeFragmentName(container.getId(), itemId)); 
            mCurTransaction.add(container.getId(), fragment,
                    getTag(position));
        } 
        if (fragment != mCurrentPrimaryItem) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        } 
 
        return fragment;
    } 
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        } 
        if (DEBUG) Log.v(TAG, "Detaching item #" + getItemId(position) + ": f=" + object
                + " v=" + ((Fragment) object).getView());
        mCurTransaction.detach((Fragment) object);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Fragment getFragmentManager Questions & Answers:

getFragmentManager Method Overview
Return the FragmentManager for interacting with fragments associated with this fragment's activity.
See Code Examples for other Android Fragment Methods: