My application has one LinearLayout
that LinearLayout
consists of the 3 Linearlayouts
and that each linear layout has one Relativelayout
and one linear layout(initially the visibility of these linear layouts is gone). If you click on the relative layout then the regarding linear layout will be displayed. But how to refresh the entire linear layout after clicking on the relative layout.
Code:
private OnClickListener exit2Listener = new OnClickListener()
{
public void onClick(View v)
{
if(!exit2status)
{
if(RB_Constant.upcomingexits_obj.response.size() > 1)
{
if(RB_Constant.upcomingexits_obj.response.get(1).listRestaurants.size() > 0)
{
// Create the views on the fly instead of using the ListView
UpcomingResultsListViewAdapter2 rbupcadapter2 = new UpcomingResultsListViewAdapter2(RB_UpcomingExits.this);
int numItems2 = 0;
if(RB_Constant.upcomingexits_obj.response.get(1).listRestaurants.size() > 0)
{
numItems2 = RB_Constant.upcomingexits_obj.response.get(1).listRestaurants.size();
}
//linearLayout2
for(int position=0; position < numItems2; position++)
{
View convertview = null;
convertview = rbupcadapter2.getView(position, convertview, null);
listLayout2.addView(convertview);
}
}
}
else
{
//toastMsg("No results!");
}
listLayout2.setVisibility(View.VISIBLE);
exit2status=true;
if(!exit1status || exit3status || exit4status || exit5status)
{
//System.out.println("exit2 GONE");
listLayout1.setVisibility(View.GONE);
listLayout3.setVisibility(View.GONE);
exit1status = false;
exit3status = false;
}
LLExitDetails.invalidate();
}
else
{
System.out.println("exit2 GONE");
listLayout2.setVisibility(View.GONE);
exit2status = false;
LLExitDetails.invalidate();
}
}
};