开发者

How to know whether the List View is Active or not?

开发者 https://www.devze.com 2023-01-15 19:19 出处:网络
Hai dude, I developed an application which intially displayed Games Listview , suppose if the user clicks the football elemnet in that games listview, then the football listview opens ,in that if user

Hai dude, I developed an application which intially displayed Games Listview , suppose if the user clicks the football elemnet in that games listview, then the football listview opens ,in that if user selected the particular player listview, then it is di开发者_如何学JAVAsplayed, my problem is i want 2 know which listview is in active.

Can any one help me regarding on this?

if(tabHost.getCurrentTab() == 2)
                    {  
                        Log.v("I m Here Boss","0");
                        if(findViewById(R.id.bars_school_details).getVisibility() == View.VISIBLE)
                        {
                            Log.v("I m Here Boss","1");
                            findViewById(R.id.bars_school_details).setVisibility(View.GONE);
                            findViewById(R.id.bars_list).setVisibility(View.GONE);
                            findViewById(R.id.bars).setVisibility(View.VISIBLE);
                        }
                        else if(findViewById(R.id.bars_list).getVisibility() == View.VISIBLE)
                        {
                            Log.v("I m Here Boss","2");
                            findViewById(R.id.bars_school_details).setVisibility(View.VISIBLE);
                            findViewById(R.id.bars_list).setVisibility(View.GONE);
                            findViewById(R.id.bars).setVisibility(View.GONE);
                        }

                    }


Finally I got solution for this, i changed my code as

try {
                    if(tabHost.getCurrentTab() == 2)
                    { 
                      try{

                            if(BS_.lv_bardate.getVisibility() == View.VISIBLE)
                            {
                                BS_Bars.lv_bardate.setVisibility(View.GONE);
                                BS_Bars.lv_barlist.setVisibility(View.GONE);
                                BS_Main.tv.setText("Schools");
                                BS_Bars.lv.setVisibility(View.VISIBLE);

                            }
                            if(BS_Bars.lv_barlist.getVisibility() == View.VISIBLE)
                            {
                                BS_Bars.lv_bardate.setVisibility(View.VISIBLE);
                                BS_Main.tv.setText("Dates");
                                BS_Bars.lv_barlist.setVisibility(View.GONE);
                                BS_Bars.lv.setVisibility(View.GONE);
                            }


    if(BS_Bars.sv.getVisibility() == View.VISIBLE)
                                {
                                    BS_Bars.lv_bardate.setVisibility(View.GONE);
                                    BS_Bars.lv_barlist.setVisibility(View.VISIBLE);


    BS_Bars.lv.setVisibility(View.GONE);
                            }



    if(BS_Bars.lv.getVisibility() == View.VISIBLE)
                                {
    //                              BS_Bars.lv_bardate.setVisibility(View.GONE);
    //                              BS_Bars.lv_barlist.setVisibility(View.GONE);
    //                              BS_Bars.lv.setVisibility(View.GONE);
                                    finish();
                                }

                            }

                        catch(Exception e)
                        {
                            Log.v("BSMain","Error in Bar Module Back Button");
                        }
                    }
0

精彩评论

暂无评论...
验证码 换一张
取 消