Hi all new to Android but have seen many tutorials. Can you let me know if I have the wrong approach or if something is wrong with my code?

I have 3 separate, stripped down, classes (Test1, Test2, Test3) which are basically identical except layout. All of the classes extend Activity... I want to be able to navigate from one class to the other via an Action Bar spinner. My app has menu items that bring up Test1 activity with the spinner. So once

I believe I have everything setup correctly; however, when I start the application (ie., Test1) onNavigationItemSelected fires off switch (itemPosition) case 0. When I navigate to Test1 (case 1) it goes there but then fires off case 0.


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

// Create an array adapter to populate dropdownlist
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_spinner_dropdown_item, R.array.action_list);

/// Enabling dropdown list navigation for the action bar
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

/// Defining Navigation listener
ActionBar.OnNavigationListener navigationListener = new OnNavigationListener() {

@Override
public boolean onNavigationItemSelected(int itemPosition, long itemId) {

switch (itemPosition) {
case 0:
makeToast ("Main");
Intent ft1 = new Intent(Test1.this, Test1.class);
startActivity(ft1);
finish();
break;
case 1:
makeToast ("Fit Test 1");
Intent ft2 = new Intent(Test1.this, Test2.class);
startActivity(ft2);
finish();
break;
case 2:
makeToast ("Fit Test 2");
Intent ft3 = new Intent(Test1.this, Test3.class);
startActivity(ft3);
finish();
break;
}
return false;
}
};

// Setting dropdown items - item navigation listener for the actionbar
getActionBar().setListNavigationCallbacks(adapter, navigationListener);
}

// MMMMMmmm Toast
public void makeToast(String message) {
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
}
}