0
 
    private ActionBar actionBar;
 
    private void init_action_bar() { 
        actionBar = getActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle("I am new here...");
        actionBar.addTab(actionBar.newTab()
                .setText("Lectures")
                .setTabListener(new TabListener<LectureFragment>(
                        this, "lectures", LectureFragment.class)));
        actionBar.addTab(actionBar.newTab()
                .setText("Map")
                .setTabListener(new TabListener<MapFragment>(
                        this, "map", MapFragment.class)));
        actionBar.addTab(actionBar.newTab()
                .setText("Todo")
                .setTabListener(new TabListener<TodoFragment>(
                        this, "todo", TodoFragment.class)));
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.layout.main_view_menu, menu);
        return true; 
    } 
 
    @Override 
    public boolean onOptionsItemSelected(MenuItem item) {
        String txt = item.getTitle().toString();
        if (txt.equals("New Todo")) {
            Intent intent = new Intent(this, NewTodoItemActivity.class);
            startActivity(intent);
            Toast t = Toast.makeText(getApplicationContext(), "shit", 1000);
            t.show();
        } 
        if (txt.equals("Edit")) {
        } 
        return true; 
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init_action_bar(); 
        if (savedInstanceState != null) {
            actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
        } 
    } 
 
    @Override 
    public void onLocationChanged(Location location) {
Contextual code suggestions in your IDE  Get Codota for Java