Android Open Source - trivial-lists Single Fragment Activity






From Project

Back to project page trivial-lists.

License

The source code is released under:

MIT License

If you think the Android project trivial-lists 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 org.hbabcock.triviallists;
/*w  w w  .  j  a va  2 s. com*/
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;

public abstract class SingleFragmentActivity extends FragmentActivity{
  protected abstract Fragment createFragment();
  
  @Override
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.single_fragment_activity);
    FragmentManager fm = getSupportFragmentManager();
    Fragment fragment = fm.findFragmentById(R.id.fragmentContainer);
    
    if (fragment == null){
      fragment = createFragment();
      fm.beginTransaction()
        .add(R.id.fragmentContainer, fragment)
        .commit();
    }
  }
}




Java Source Code List

org.hbabcock.triviallists.CategoryActivity.java
org.hbabcock.triviallists.CategoryDeleteDialog.java
org.hbabcock.triviallists.CategoryFragment.java
org.hbabcock.triviallists.CategoryItemManager.java
org.hbabcock.triviallists.Category.java
org.hbabcock.triviallists.GenericEditorDialogFragment.java
org.hbabcock.triviallists.ItemFragmentEdit.java
org.hbabcock.triviallists.ItemFragmentShop.java
org.hbabcock.triviallists.ItemFragment.java
org.hbabcock.triviallists.ItemPagerActivity.java
org.hbabcock.triviallists.Item.java
org.hbabcock.triviallists.SingleFragmentActivity.java
org.hbabcock.triviallists.TrivialListJSONSerializer.java