I have a problem with the ListView
s that is: Work with 2 ListView
se want that when I click on one, the other disappears and does not make them overlap as it has been . I just want that when I click and open the first ListView
and then immediately before if I click to open the second ListView
, the first to close.
The code I'm using is this and can also be seen in 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;
}
}