Back to project page StikkyHeader.
The source code is released under:
Apache License
If you think the Android project StikkyHeader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package it.carlom.stickyheader.example; //from ww w .j av a 2 s. c om import android.app.Activity; import android.app.Fragment; import android.os.Bundle; import it.carlom.stickyheader.example.fragment.MainFragment; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { loadFragment(new MainFragment()); } } public void loadFragment(final Fragment fragment) { getFragmentManager().beginTransaction().replace(R.id.layout_container, fragment, fragment.getClass().getName()).addToBackStack(fragment.getClass().getName()).commit(); } }