Android Open Source - FragmentTutorial Fragment By Xml






From Project

Back to project page FragmentTutorial.

License

The source code is released under:

Apache License

If you think the Android project FragmentTutorial listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.yanlu.android.fragment.frg;
/*from w w  w.  j  ava 2 s. co m*/
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yanlu.android.fragment.R;

/**
 * User: captain_miao
 * Date: 14-5-7
 * Time: ????9:23
 */
public class FragmentByXml extends Fragment {
    private static final String TAG = "FragmentByXml";

    public FragmentByXml() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        setRetainInstance(true);//Static fragment are always recreated
        return inflater.inflate(R.layout.fragment_setting, container, false);
    }


    @Override
    public void onResume() {
        super.onResume();
        Log.d(TAG, "onResume( )");
    }


    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        Log.d(TAG, "onAttach(activity)");

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate(savedInstanceState)");

    }

    @Override
    public void onDetach() {
        super.onDetach();
        Log.d(TAG, "onDetach( )");
    }




    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d(TAG, "onActivityCreated(savedInstanceState)");
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.d(TAG, "onStart( )");
    }


    @Override
    public void onPause() {
        super.onPause();
        Log.d(TAG, "onPause( )");
    }

    @Override
    public void onStop() {
        super.onStop();
        Log.d(TAG, "onStop( )");
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        Log.d(TAG, "onDestroyView( )");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "onDestroy( )");
    }
}




Java Source Code List

com.yanlu.android.fragment.App.java
com.yanlu.android.fragment.MainActivity.java
com.yanlu.android.fragment.SettingsActivity.java
com.yanlu.android.fragment.frg.FragmentByXml.java
com.yanlu.android.fragment.frg.LeftFragment.java
com.yanlu.android.fragment.frg.RightFragment.java
com.yanlu.android.fragment.model.DemoDataMo.java
com.yanlu.android.fragment.model.DemoParcel.java
com.yanlu.android.fragment.net.GsonRequest.java
com.yanlu.android.fragment.net.LruBitmapCache.java
com.yanlu.android.fragment.net.RequestManager.java