Example #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ThemeService.applyTheme(this);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tag_updates_activity);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowTitleEnabled(false);

    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setCustomView(R.layout.header_title_view);
    ((TextView) actionBar.getCustomView().findViewById(R.id.title))
        .setText(R.string.TAd_contextEditTask);

    Fragment fragment;
    String tag;
    if (getIntent().getExtras().containsKey(TaskCommentsFragment.EXTRA_TASK)) {
      fragment = new TaskCommentsFragment();
      tag = "taskupdates_fragment"; // $NON-NLS-1$
    } else {
      fragment = new TagCommentsFragment();
      tag = "tagupdates_fragment"; // $NON-NLS-1$
    }

    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.comments_fragment_container, fragment, tag);
    transaction.commit();
  }