I'm using setOnItemSelectedListener
when ArrayList size is 0.
It doesn't return the Toast when u press the same option,
just return it when change the option,
I want setOnItemSelectedListener
do the Toast when
u press same option.
I tried with setOnItemSelectedListener
and when ArrayList size is 0,
it doesn't return the toast when u press the same option,
just do it when change the option
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int
position, long id) {
if(position==1){
if(turismo1.size()!=0){
code......
}else{
Toast.makeText(getApplicationContext(), "No hay
turismos",
Toast.LENGTH_LONG).show();
l.setAdapter(adaptador1);
}
}else if(position==2){
code....
}else{
Toast.makeText(getApplicationContext(), "No hay
transportes",Toast.LENGTH_LONG).show();
l.setAdapter(adaptador2);
}
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
I want to see the toast when press an option even if the option is the same. Obviously when the ArrayList size is 0.