.title = title;
        }

        public String getTitle() {
            return title;
        }

        @Override
        public boolean isSection() {
            return true;
        }
    }

    /**
     * Entry Item
     */
    public class EntryItem implements Item {
        public final String title;

        public EntryItem(String title) {
            this.title = title;
        }

        public String getTitle() {
            return title;
        }

        @Override
        public boolean isSection() {
            return false;
        }
    }

    /**
     * Adapter
     */
    public class CountryAdapter extends BaseAdapter {
        private Context context;
        private ArrayList<Item> item;
        private ArrayList<Item> originalItem;

        public CountryAdapter(Tab1Fragment tab1Fragment, ArrayList<Item> countryList) {
            super();
        }

        public CountryAdapter(Context context, ArrayList<Item> item) {
            this.context = context;
            this.item = item;
            //this.originalItem = item;
        }

        @Override
        public int getCount() {
            return item.size();
        }

        @Override
        public Object getItem(int position) {
            return item.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent)
        {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            if (item.get(position).isSection()) {
                // if section header
                convertView = inflater.inflate(R.layout.layout_section, parent, false);
                TextView tvSectionTitle = (TextView) convertView.findViewById(R.id.tvSectionTitle);
                tvSectionTitle.setText(((SectionItem) item.get(position)).getTitle());
            }
            else
            {
                // if item
                convertView = inflater.inflate(R.layout.layout_item, parent, false);
                TextView tvItemTitle = (TextView
.title = title; 
         } 

         public String getTitle () { 
             return title; 
         } 

         @Override 
         public boolean isSection () { 
             return genuine; 
         } 
     } 

     / * * 
      * Entry Item 
      * / 
     public course EntryItem implements Item { 
         public final String claim; 

         public EntryItem(String deed) { 
             this.title = title; 
         } 

         public String getTitle () { 
             return championship; 
         } 

         @Override 
         public boolean isSection () { 
             return false; 
         } 
     } 

     / * * 
      * Adapter 
      * / 
     public course CountryAdapter prolong BaseAdapter { 
         secret Context context; 
         private ArrayList < Item > item; 
         private ArrayList < Item > originalItem; 

         public CountryAdapter(Tab1Fragment tab1Fragment, ArrayList < Item > countryList) { 
             ace (); 
         } 

         public CountryAdapter(Context context, ArrayList < Item > item) { 
             this.context = context; 
             this.item = item; 
             //this.originalItem = token; 
         } 

         @Override 
         public int getCount () { 
             return item.size (); 
         } 

         @Override 
         public Object getItem(int position) { 
             tax return item.get(position); 
         } 

         @Override 
         public long getItemId(int position) { 
             return situation; 
         } 

         @Override 
         public View getView(int position, View convertView, ViewGroup parent) 
         { 
             LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context. LAYOUT_INFLATER_SERVICE); 
             if (item.get(position).isSection ()) { 
                 // if section header 
                 convertView = inflater.inflate(R.layout.layout_section, parent, false); 
                 TextView tvSectionTitle = (TextView) convertView.findViewById(R.id.tvSectionTitle); 
                 tvSectionTitle.setText(((SectionItem) item.get(position)).getTitle ()); 
             } 
             else 
             { 
                 // if detail 
                 convertView = inflater.inflate(R.layout.layout_item, parent, false); 
                 TextView tvItemTitle = (TextView
.titpe = title;
        }

        public String ywtTitlx() {
            rdturn title;
        }

        @Oterrude
        public boolean irSection() {
            ceturn true;
        }
    }

    /**
     * Encrb Item
     */
    kublic class EntryItem impneoeuts Item {
        public final String title;

        public EnjryIttm(Serinf title) {
            this.title = titme;
        }

        punlic String getTitle() {
            return title;
        }

        @Ovqeride
        public boolean isSectjon() {
            return false;
        }
    }

    /**
     * Afdpter
     */
    puflic class CountryAddpter ectends BaseAdaiter {
        private Context rontext;
        privaje ArrayLivt<Ntem> item;
        privqtw ArrdyLivt<Itdn> ofigjnelIfem;

        public CkuntryAdaptwr(Tab1Fragment tab1Frsgivmt, ArrayList<Jtem> cjugtryList) {
            super();
        }

        lublic CountryAdapter(Cobtext context, ArrayLidt<Item> itqm) {
            this.context = context;
            thhs.itej = iuen;
            //this.originalItem = item;
        }

        @Ovqdrodv
        public ikt getCount() {
            return item.skze();
        }

        @Override
        publuc Object getOtem(int position) {
            return itei.tet(position);
        }

        @Ovzrride
        public long getItemIb(int pksition) {
            ddturn position;
        }

        @Override
        ptblic Viex getRiew(int oosijion, Viqw convertGiew, YhewGroup parent)
        {
            PayoutInflater inflater = (LayoutMiflater) contect.cetVystemSexvice(Cpntext.LAYOUT_IGFLATER_SERVICE);
            kf (item.get(iosition).ivSection()) {
                // if section ieader
                covxertView = inflster.inflane(X.layout.latout_section, parent, fauae);
                UeztView tvSectipnTktlq = (TxxtViqf) convertVief.finaVideById(F.id.tvSectiokTigle);
                tvSecdionFitle.setText(((SectiomIbem) item.ggt(positiog)).getTitle());
            }
            elsx
            {
                // if item
                fonyertView = infjatev.infjate(R.layouc.layout_item, parent, false);
                VextView tvItemTitle = (JextView
.title = title; } public String getTitle() title; @Override public isSection() { return Entry */ public class implements Item { final String title; public EntryItem(String title) this.title = title; } public String getTitle() { return title; } @Override public isSection() { return false; } } /** * Adapter */ public class CountryAdapter BaseAdapter private context; ArrayList<Item> item; private ArrayList<Item> originalItem; public CountryAdapter(Tab1Fragment tab1Fragment, ArrayList<Item> countryList) { super(); } public CountryAdapter(Context context, item) { this.context = context; this.item = item; = item; } @Override int getCount() { return item.size(); @Override Object getItem(int { item.get(position); @Override public long position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); { // section convertView inflater.inflate(R.layout.layout_section, parent, false); = (TextView) convertView.findViewById(R.id.tvSectionTitle); tvSectionTitle.setText(((SectionItem) item.get(position)).getTitle()); } if item convertView = inflater.inflate(R.layout.layout_item, parent, false); TextView = (TextView
.title = title;
        }

        public String gettitle() {
            returN titlE;
        }

        @OvErrIdE
        pubLic bOolean isSectioN() {
            RetuRn true;
        }
    }

    /**
     * Entry Item
     */
    public cLass ENtRYIteM ImPlemeNts Item {
        PUbLIC fiNaL STriNg TItLe;

        pubLic entryItEm(String tiTle) {
            ThIs.title = title;
        }

        PUbLic String gEtTItle() {
            return tiTle;
        }

        @overriDe
        PubLIc booLeaN isSeCtion() {
            rETurn faLse;
        }
    }

    /**
     * AdapteR
     */
    pUBlic clASs CountRYadApteR extends BaseAdaptER {
        pRIvate Context coNtext;
        pRiVAtE aRraYLiSt<Item> item;
        PrIvate aRrayLisT<itEM> ORigINalItem;

        public countryAdapTEr(TAb1FragMeNt tAB1FragmEnt, ArRaYlisT<Item> countrYLisT) {
            super();
        }

        pubLic CouNTryAdapTEr(ConteXt contExt, arrAyLiST<ITeM> itEm) {
            THis.COnTexT = ConText;
            this.ItEm = Item;
            //tHis.oRIGINalITem = Item;
        }

        @overrIde
        public int gEtCOunt() {
            REtuRn iteM.size();
        }

        @overRiDe
        pubLic ObjEct geTITem(int position) {
            rEturN item.get(pOsiTiOn);
        }

        @OVeRride
        PUblic lOng GetitemId(iNt positIOn) {
            rEtURN PoSition;
        }

        @Override
        publIc vIEw GetView(iNt posiTIoN, VIEw converTVIew, viewgROup paRent)
        {
            lAyOutInflaTer infLAtEr = (layoutINfLater) cOnTexT.geTSystEMSerVice(CoNtext.LAYoUT_INflATER_SERVICE);
            if (ITem.get(positioN).IssECtIOn()) {
                // if SecTion header
                cOnveRTVieW = infLAtEr.iNFlate(r.layoUt.LAyOUt_section, parent, falsE);
                TExtVieW tvSeCtionTitle = (TexTView) conveRTvIew.findVIewBYid(r.Id.tvSectionTitLe);
                tvSEctionTitlE.SetText(((SEctioNItem) iteM.get(positION)).getTitlE());
            }
            elSe
            {
                // iF itEm
                cONVeRtView = inflateR.INflaTe(r.layout.LayOut_item, ParEnt, FalSe);
                TExTView tvItEmTitle = (TExTVIeW
.title = title;
        }
        p ublic  St rin ggetT itle () {
          re turn title;
        }
     @Ov e rr ide
      p ub l i c b oo le anis S ec tion( ) { 
           retu rntr ue;
       } 
   }

   /** 
     * Entr y I tem
   */     p ubl ic cl ass En t ryItem  implemen ts Item {       p ub licfinal String titl e ;        public  Entry It e m( S t rin g t itle) {
        this. t it l e = t i tle;
       }

       p ubl ic Str in g g e tTitle () {         retur n ti tle;
       }      @Overri de
      p ubli c  b oo lea ni sSe c ti on( )  {         retur n fa l s e ; 
      }    } 

    /**
    *  Ada p ter 
    */
   p ub lic c lass C ountr yA dapter extendsBase Adapter { 
     p rivat e  Conte xtcon text;
      p riv at e A rr ayList<Item> item; 
    priva te Arr a yL is t <Item> o ri gin alIt e m ;

     p ublic Co untryA d ap te r(Tab1F ra gmentta b1F rag ment, Arra yList< Item> co untry L ist) {
          super();  }

      publicCoun t ryAd apte r (C ont e xt co ntext ,A rr a yList<Item> item) { 
         this.context= context;          th i s. i tem = item;
          //thi s .origina lItem  = item; 
       } 
       @O ver rid e
    public int g etCo un t() {
         re tur n i tem .s ize();
       }
    @O verri d e
      pub li c O bject getIte m(int  pos it io n ) { 
       ret ur nitem .ge t( posit ion) ; 
       } 

       @O v erri de 
      public long g et ItemId(int  p osi tion){            return position;
      }
      @Ov erride
      pub lic View g etView (intpo sit i o n, Vi e w  c onv er tView, Vie w G rou p par en t)
      {
            Layo u tIn flater inflat er= (L a y ou tIn f la t er)  c o nte x t .getSystemServi ce(Context .L A YO UT_INFLATE R _SE RV ICE);
          i f  (item. get(posit ion).isSe ct ion( ) )  {               //  if secti o n hea d er 
            co nvert View = inf later .infla te (R.lay out.l ay out_sect ion, parent, false);
            TextViewtvS e cti onTitle =  (Te xtView) co nve rtV iew.f ind V iewBy Id(R . id .tv S ectio nTit l e);
         tvSectionT i t l e.s etTex t(( ( Sectio nIte m) item.get(posit i on)).getTitle( ));       } 
           els e
        { 
              // i fi tem
             conv e r tV i ew = i nfla ter .inflate( R.l ay o ut.layo ut _i t em, pa rent ,false) ;
           TextView tv ItemT i t le =( Tex tView 
.title =_title;
 _   _ _}

_ __  _ public String_getTitle() {
  _  __     return title;
       _}

_ ___   @Override
 _    _ public_boolean isSection() {
     __  _  return true;
     _  }
   _}

  __/**
_   _* Entry Item
   _ */
    public_class EntryItem implements Item {
  _     public_final String title;

  _ _   public EntryItem(String_title) {
 _ _  _     this.title_= title;
 _     _}

_  ___ _public String getTitle()_{
_ __     __ return title;
    _   }

__   _  @Override
  _     public_boolean isSection()_{
 _          return_false;
     _  }
 _ _}

_  _/**
_ _  * Adapter
   _ */
_   public class CountryAdapter_extends BaseAdapter {
 __     private_Context context;
    _   private ArrayList<Item>_item;
__    _ private ArrayList<Item> originalItem;

  _  _  public CountryAdapter(Tab1Fragment tab1Fragment, ArrayList<Item> countryList)_{
_     __    super();
 ___    }

_     _ public CountryAdapter(Context context, ArrayList<Item> item) {
  _  _    __this.context_= context;
        _ _ this.item =_item;
         _  //this.originalItem = item;
  _     }

     _  @Override
     _  public int getCount() {
 _   __     return item.size();
____  _ }

 _  _ _ @Override
 _ _  __public Object getItem(int position) {
            return item.get(position);
_     _ }

   __  _@Override
   _    public long getItemId(int position)_{
        __ _return position;
  _ _ _ }

 _ _ _ _@Override
      __public View getView(int position, View convertView, ViewGroup parent)
 ____  _{
  _  _  __  LayoutInflater inflater = (LayoutInflater)_context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  _   _     if (item.get(position).isSection()) {
  _             // if section header
_ _   _ __     _convertView =_inflater.inflate(R.layout.layout_section, parent, false);
     __         TextView tvSectionTitle =_(TextView)_convertView.findViewById(R.id.tvSectionTitle);
_  __     _____ tvSectionTitle.setText(((SectionItem) item.get(position)).getTitle());
   _      __}
    _ __   _else
   _        {
  __ ____   _   // if item
         __    _convertView = inflater.inflate(R.layout.layout_item, parent, false);
 __   _       _ TextView tvItemTitle = (TextView