I have a problem with the% s of% s which is as follows: I work with 2% with% s and I want when I click on one, that the other disappears and that they do not overlap as they have. I just want it when I click and open the first ListView
and then sooner if I click to open the second ListView
, let the first one close.
The code I am using is this and can also be seen by the following image:
switch (v.getId()) {
case R.id.like:
preecheListLike();
listaLike.setVisibility(View.VISIBLE);
listaLike.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String nome = listaLike.getItemAtPosition(position).toString();
setMarker(latit, longi, nome, true, position);
listaLike.setVisibility(View.INVISIBLE);
setUpMap();
}
});
break;
case R.id.dislike:
preecheListDislike();
listaDislike.setVisibility(View.VISIBLE);
//listaLike.setVisibility(View.INVISIBLE);
listaDislike.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String nome = listaDislike.getItemAtPosition(position).toString();
setMarker(latit, longi, nome, false, position);
listaDislike.setVisibility(View.INVISIBLE);
setUpMap();
}
});
break;
case R.id.rota:
//AQUI ATIVA O BOTAO CALCULAR ROTA
//showDist.setVisibility(View.VISIBLE);
calcRout.setVisibility(View.VISIBLE);
yourDest.setVisibility(View.VISIBLE);
break;
}
}
Image illustrating the problem: