package com.monmonja.firstDemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;

public class Main extends Activity {
	private int searchBtnId = Menu.FIRST;
    private int scheduleBtnId = Menu.FIRST + 1;
    private int playBtnId = Menu.FIRST + 2;
    private int stopBtnId = Menu.FIRST + 3;
    private int group1Id = 1;
    private int group2Id = 2;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add(group1Id,searchBtnId ,searchBtnId,"Search");
        menu.add(group2Id,scheduleBtnId ,scheduleBtnId,R.string.schedule);
        menu.add(group2Id,playBtnId ,playBtnId,"Play");
        menu.add(group2Id,stopBtnId ,stopBtnId,R.string.stop);
        // the following line will hide search
        // when we turn the 2nd parameter to false
        menu.setGroupVisible(1, false);
        return super.onCreateOptionsMenu(menu);
    }

}