package org.pestrada.android_tdd_playground;

import android.app.ActionBar;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.widget.ArrayAdapter;

public class MainActivity extends FragmentActivity implements
    ActionBar.OnNavigationListener {

  private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

    actionBar.setListNavigationCallbacks(
        new ArrayAdapter<String>(actionBar.getThemedContext(),
            android.R.layout.simple_list_item_1, android.R.id.text1,
            new String[] { getString(R.string.title_section1),
                getString(R.string.title_section2),
                getString(R.string.title_section3), }), this);
  }

  @Override
  public void onRestoreInstanceState(Bundle savedInstanceState) {
    if (savedInstanceState.containsKey(STATE_SELECTED_NAVIGATION_ITEM)) {
      getActionBar().setSelectedNavigationItem(
          savedInstanceState.getInt(STATE_SELECTED_NAVIGATION_ITEM));
    }
  }

  @Override
  public void onSaveInstanceState(Bundle outState) {
    outState.putInt(STATE_SELECTED_NAVIGATION_ITEM, getActionBar()
        .getSelectedNavigationIndex());
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
  }

  @Override
  public boolean onNavigationItemSelected(int position, long id) {
    Fragment fragment = new DummySectionFragment();
    Bundle args = new Bundle();
    args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, position + 1);
    fragment.setArguments(args);
    getSupportFragmentManager().beginTransaction()
        .replace(R.id.container, fragment).commit();
    return true;
  }

}

@@ -43,38 +43,8 @@
 d;%0A%0A
-import android.app.ActionBar;%0A
 impo
@@ -107,1964 +107,222 @@
 ment
-;%0Aimport android.support.v4.app.FragmentActivity;%0Aimport android.view.Menu;%0Aimport android.widget.ArrayAdapter;%0A%0Apublic class MainActivity extends FragmentActivity implements%0A    ActionBar.OnNavigationListener %7B%0A%0A  private static final String STATE_SELECTED_NAVIGATION_ITEM = %22selected_navigation_item%22;%0A%0A  @Override%0A  protected void onCreate(Bundle savedInstanceState) %7B%0A    super.onCreate(savedInstanceState);%0A    setContentView(R.layout.activity_main);%0A%0A    final ActionBar actionBar = getActionBar();%0A    actionBar.setDisplayShowTitleEnabled(false);%0A    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);%0A%0A    actionBar.setListNavigationCallbacks(%0A        new ArrayAdapter%3CString%3E(actionBar.getThemedContext(),%0A            android.R.layout.simple_list_item_1, android.R.id.text1,%0A            new String%5B%5D %7B getString(R.string.title_section1),%0A                getString(R.string.title_section2),%0A                getString(R.string.title_section3), %7D), this);%0A  %7D%0A%0A  @Override%0A  public void onRestoreInstanceState(Bundle savedInstanceState) %7B%0A    if (savedInstanceState.containsKey(STATE_SELECTED_NAVIGATION_ITEM)) %7B%0A      getActionBar().setSelectedNavigationItem(%0A          savedInstanceState.getInt(STATE_SELECTED_NAVIGATION_ITEM));%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void onSaveInstanceState(Bundle outState) %7B%0A    outState.putInt(STATE_SELECTED_NAVIGATION_ITEM, getActionBar()%0A        .getSelectedNavigationIndex());%0A  %7D%0A%0A  @Override%0A  public boolean onCreateOptionsMenu(Menu menu) %7B%0A    getMenuInflater().inflate(R.menu.main, menu);%0A    return true;%0A  %7D%0A%0A  @Override%0A  public boolean onNavigationItemSelected(int position, long id) %7B%0A    Fragment fragment = new DummySectionFragment();%0A    Bundle args = new Bundle();%0A    args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, position + 1);%0A    fragment.setArguments(args);%0A    getSupportFragmentManager().beginTransaction()%0A        .replace(R.id.container, fragment).commit();%0A    return true
+Activity;%0A%0Apublic class MainActivity extends FragmentActivity %7B%0A%0A  @Override%0A  protected void onCreate(Bundle savedInstanceState) %7B%0A    super.onCreate(savedInstanceState);%0A    setContentView(R.layout.activity_main)
 ;%0A  

remove unecessary code