0

I have a problem with the ListViews that is: Work with 2 ListViewse 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;


    }

}
  • A PICTURE FOR SHOE MY PROBLEM: http://i58.tinypic.com/105t7jd.jpg –  Feb 05 '15 at 04:10
  • http://stackoverflow.com/questions/17693578/android-how-to-display-2-listviews-in-one-activity-one-after-the-other/17693628#17693628 – Nirmal Feb 05 '15 at 05:12

0 Answers0