Android Open Source - AndroidLifecycleTest Main Activity






From Project

Back to project page AndroidLifecycleTest.

License

The source code is released under:

MIT License

If you think the Android project AndroidLifecycleTest 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.example.lifecycletest;
/* w w  w.j  av a  2s. c o m*/
import android.os.Bundle;

public class MainActivity extends LifeCycleActivity {

    /**
     * This activity creates a fragment by FragmentManager.
     */

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        setTag(getClass().getSimpleName(), this);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getActionBar().setTitle("MainActivity");

        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .add(R.id.container, new MainFragment())
                    .commit();
        }
    }
}




Java Source Code List

com.example.lifecycletest.ApplicationTest.java
com.example.lifecycletest.LifeCycleActivity.java
com.example.lifecycletest.LifeCycleFragment.java
com.example.lifecycletest.MainActivity.java
com.example.lifecycletest.MainFragment.java
com.example.lifecycletest.SampleFragment.java
com.example.lifecycletest.SecondActivity.java
com.example.lifecycletest.ThirdActivity.java