You repeatedly set the listener only on your first number picker (np1)
EDIT:
Alright, I see. How about storing references to your NumberPicker objects in onCreate as member variables of your Activity and just match objects in your onValueChanged listener as follows:
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
if(picker == np1) {
...
} else if(picker == np2) {
...
} ...
}
I guess you're not retrieving the correct view's id in your code snippet above:
switch (getView().getId()) { // I think this is wrong
You should call getId on the picker argument instead:
switch(picker.getId())