Commits

Juha Kuitunen committed 4a9b952

fixed bug in a9a88e5a9bc7

Comments (0)

Files changed (1)

src/com/saibotd/bitbeaker/SourceBrowserActivity.java

 	private String[] branches;
 	private SubMenu branchesMenu;
 	private Menu mainMenu;
+	private static final int BRANCHES_GROUP_ID = 1;// some non-zero id
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
 	private void setBranchesMenuItems(Menu menu) {
 		branchesMenu.clear();
 		for (int i=0; i<branches.length; i++)
-			branchesMenu.add(branches[i]);
+			branchesMenu.add(BRANCHES_GROUP_ID, Menu.NONE, Menu.NONE, branches[i]);
 	}
 
 	@Override
 	public boolean onOptionsItemSelected(MenuItem item) {
-		if (!item.getTitle().equals(getString(R.string.branch))) {
+		if (item.getGroupId() == BRANCHES_GROUP_ID) {
 			Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT).show();
 			return true;
 		}