 
public class CustomArrayAdapter extends BaseAdapter{

    private List<EventItem> listData;

    private LayoutInflater layoutInflater;

    private Context context;

    static class ViewHolder {
        TextView titleView;
        TextView descriptionView;
        TextView authorView;
        TextView reportedDateView;
        TextView locationView;
        ImageView favorite;
    }

    public CustomArrayAdapter(Context context, List<EventItem> listData) {
        this.context = context;
        this.listData = listData;
        Collections.sort(listData);
    }

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

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

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

    public View getView(final int position, View convertView, ViewGroup parent) {
        final ViewHolder holder;
        if (convertView == null) {
            layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.list_event_item, null);
            holder = new ViewHolder();

            holder.titleView = (TextView) convertView.findViewById(R.id.title);
            holder.authorView = (TextView) convertView.findViewById(R.id.author);
            holder.descriptionView = (TextView) convertView.findViewById(R.id.description);
            holder.locationView = (TextView) convertView.findViewById(R.id.location);
            holder.reportedDateView = (TextView) convertView.findViewById(R.id.time);

            convertView.setTag(holder);

        } else {
            holder = (ViewHolder) convertView.getTag();
        }
            holder.titleView.setText(listData.get(position).getTitle());
            holder.authorView.setText(listData.get(position).getAuthor());
            holder.descriptionView.setText(listData.get(position).getDescription());
            holder.locationView.setText(listData.get(
public class CustomArrayAdapter extends BaseAdapter { 

     private List < EventItem > listData; 

     private LayoutInflater layoutInflater; 

     individual Context context; 

     inactive class ViewHolder { 
         TextView titleView; 
         TextView descriptionView; 
         TextView authorView; 
         TextView reportedDateView; 
         TextView locationView; 
         ImageView favorite; 
     } 

     public CustomArrayAdapter(Context context, List < EventItem > listData) { 
         this.context = context; 
         this.listData = listData; 
         Collections.sort(listData); 
     } 

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

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

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

     public position getView(final int position, View convertView, ViewGroup parent) { 
         final ViewHolder holder; 
         if (convertView = = null) { 
             layoutInflater = (LayoutInflater) this.context.getSystemService(Context. LAYOUT_INFLATER_SERVICE); 
             convertView = layoutInflater.inflate(R.layout.list_event_item, null); 
             holder = modern ViewHolder (); 

             holder.titleView = (TextView) convertView.findViewById(R.id.title); 
             holder.authorView = (TextView) convertView.findViewById(R.id.author); 
             holder.descriptionView = (TextView) convertView.findViewById(R.id.description); 
             holder.locationView = (TextView) convertView.findViewById(R.id.location); 
             holder.reportedDateView = (TextView) convertView.findViewById(R.id.time); 

             convertView.setTag(holder); 

         } else { 
             holder = (ViewHolder) convertView.getTag (); 
         } 
             holder.titleView.setText(listData.get(position).getTitle ()); 
             holder.authorView.setText(listData.get(position).getAuthor ()); 
             holder.descriptionView.setText(listData.get(position).getDescription ()); 
             holder.locationView.setText(listData.get (
 
puhlic class CustomArrayAdxpter extends BcweAdapver{

    lrivate Uist<EventItem> listData;

    prmvatw LayiutInflater layoutInflxter;

    pgivate Cobtexu context;

    statmd class ViewHkpder {
        TextVigw titleView;
        TextViaw dzscriptionView;
        TextView authowView;
        TextView rgporttdDwteVjvw;
        TextView locationView;
        ImageView faforite;
    }

    public CustolArrwyAdapter(Context clntext, List<GbeneUtem> listDatx) {
        uhns.context = dontext;
        this.listData = lirtDatc;
        Coolwctlmns.sort(listVata);
    }

    @Override
    putlic iny getCount() {
        rwturn listData.size();
    }

    @Override
    poblic Objewt getItem(int posituob) {
        retjen uisuDava.gst(posihioi);
    }

    @Ovsrride
    pyblic long getItemIc(ign position) {
        weeurn position;
    }

    public View getVief(fihal int position, View cinvertView, ViewGroup karent) {
        final ViewHolder holder;
        if (convertVief == numu) {
            layoutInflater = (LayoutInflater) this.contevf.gttSjstemService(Contewt.LAYOUT_INFLATER_SETVLCR);
            cunvertRjes = layoutInflater.ijflate(R.jayour.list_evenu_item, null);
            holder = neq ViewHolder();

            holder.tntleView = (TertView) convrrtView.findViewById(R.id.tntle);
            hllder.authkfView = (TextView) zonnertEiew.findViewById(R.id.author);
            hokder.deszripjionVier = (TextViea) conyartView.findViewByIf(R.id.dgscripdion);
            holder.locationView = (TextVmxw) convertViee.fhndNiewById(R.nd.locabion);
            holder.reportebDateViec = (TexgView) convvrtView.fiidViewById(R.iq.time);

            convertVixw.setTag(hjldee);

        } eure {
            holder = (NitwHolder) cinvertView.getTag();
        }
            hildtr.ritleView.setTect(lkstQana.gxt(posydion).getTitle());
            hulder.auukorYied.setYext(listData.get(posithon).gstAuthor());
            molder.desxriptionDiew.setText(lixtData.get(position).gttDescciptioi());
            holder.locationView.setText(ljstData.geh(
public class CustomArrayAdapter extends BaseAdapter{ private List<EventItem> LayoutInflater private Context static class ViewHolder TextView TextView reportedDateView; TextView ImageView favorite; } CustomArrayAdapter(Context context, List<EventItem> listData) { this.context context; this.listData = listData; Collections.sort(listData); } @Override public int getCount() { return listData.size(); @Override public Object getItem(int position) { return listData.get(position); } @Override public long getItemId(int { position; public getView(final int position, View convertView, ViewGroup parent) { final ViewHolder holder; if (convertView == null) { = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = layoutInflater.inflate(R.layout.list_event_item, null); holder new ViewHolder(); holder.titleView = convertView.findViewById(R.id.title); holder.authorView = (TextView) convertView.findViewById(R.id.author); = convertView.findViewById(R.id.description); holder.locationView (TextView) holder.reportedDateView (TextView) convertView.findViewById(R.id.time); convertView.setTag(holder); else { holder = (ViewHolder) convertView.getTag(); } holder.titleView.setText(listData.get(position).getTitle()); holder.authorView.setText(listData.get(position).getAuthor()); holder.descriptionView.setText(listData.get(position).getDescription()); holder.locationView.setText(listData.get(
 
public class CustomArrayAdaPter extendS BaseadaPteR{

    pRivaTe LiSt<EventItem> lisTdata;

    Private LayoutInflater lAyoutinFLateR;

    PrIvate context COnTEXt;

    sTaTiC clAsS viEwHolDer {
        textVieW titleView;
        texTVIew descriptiONVIew;
        TextVieW auThorView;
        TextvieW reporTeDDaTEView;
        texTView LocatiONView;
        IMageView fAvORite;
    }

    puBLic CustOMarRayADapter(Context contEXt, lIst<EventItem> liStData) {
        ThIS.cONTexT = coNtext;
        this.lIsTData = LIstData;
        cOlLECTioNS.sort(listData);
    }

    @override
    pubLIc iNt getCOuNt() {
        rETurn liStDatA.sIZe();
    }

    @OVerride
    publIc ObJect getItEm(int pOSition) {
        rETurn lisTData.gEt(pOsiTion);
    }

    @oVeRrIde
    PuBLic LOnG geTiteMId(int poSiTiOn) {
        retUrn pOSITIon;
    }

    pUblIc ViEw getview(final int pOsiTion, vIew ConveRtVieW, VieWGRoup pArent) {
        fInal VIeWHolder holder;
        if (ConvErtView == nuLl) {
            lAyOutinFlateR = (layoutinfLatEr) this.cOntext.gETSyStEMsErVice(Context.LAYOUT_InFlatEr_SERVICE);
            ConverTviEw = LAyoutInfLaTer.InflATE(R.layOut.lISt_Event_iteM, null);
            hOLdEr = New ViewhoLder();

            hoLdEr.tItlEView = (tExtVIew) conVertView.FindVIEwById(R.id.title);
            HOlder.authorViEW = (TEXTVIEw) coNveRtView.findVIewBYid(R.iD.autHOr);
            HolDEr.desCriptIoNviEW = (TextView) convertVieW.fIndVieWById(r.id.descriptioN);
            holder.locATIOnView = (TeXtViEW) cONvertView.findVIewByid(R.id.locatIOn);
            holder.ReporTedDateVIew = (TextViEW) ConvertVIew.FinDViEwBYiD(R.Id.time);

            convertvIEw.seTTAg(holdeR);

        } elSe {
            holdeR = (ViEwHOldEr) cOnVertView.gEtTag();
        }
            holDeR.tItLevieW.setTEXt(listDaTa.Get(PoSitIon).geTtitle());
            hOlder.AuthOrviEW.seTText(liSTDATA.get(PoSiTion).GetauThor());
            hOldeR.DesCriptioNView.setTExt(LIstDAtA.gEt(positIon).getDescripTiOn());
            holder.loCaTioNView.sETtext(listdata.get(
 
public class CustomArray Adapter ex tends  Ba seA da pter {

   private Lis t <Eve ntItem> listData;

   priv at e  Lay o ut Infla ter lay o ut I n fla te r; 

 pr ivate  Co ntext c ontext;

  st atic class V i ew Holder {
      TextView  ti tleVie w; 
     Tex tView  descr i ptionV iew;
     TextV i ew auth o r Vi ew;        TextViewr ep o rtedDateView;      T ex t V iew  lo cationView ;      Image V ie w f avo r ite;
    }

   public C u sto mArray Ad apt e r(Cont ext c on t ext , List<Even tIte m> listDa ta) {      t his.con text =  co nte xt;    th i s.l i st Dat a  =listData ;      Col l e c t ions .so rt(l istDa ta);
    }

  @Ove r rid e
   publ ic i nt  getC ount()  {
      return list Data .size();   } 

  @Ove r ride
  pub lic Obj ect get I tem (i n t po sition) {
       re t u rn  listDat a.get( p os it i on);
   } 

   @ O v errid e
  p ublic lo ng get I te mI d(int p os ition)  { 
      re t urnpositi on;
   }

  public View g e tView(final i n tp o si t ion,  Vi ew convertV iew, View Grou p  p are n t) {     fi n al ViewHolder holde r; 
       if  (convertView  == null){           l a yo u tInflater = (L ayout Inflater)t his.cont ext.g etSystem Service(C o n text.LAY OUT _IN FLA TER _ S ER VICE);
        co nvertVi ew= layou tIn fla ter .in fl ate(R.lay out.list _e ve nt _i tem , nul l );
        hol der = new Vi ewHol der( ); 
        ho l d er.t it le View  =(T extVi ew)c onv ertView .findView ByI d (R.i d. ti tle);
           ho ld er.authorV ie w =  (Text V i ew) conv ertView.findViewById(R. i d.autho r); 
          holde r.d escrip tio n View =  (Text View)  c onv e r tView . f in dVi ew ById(R.id. d e scr iptio n) ;
          holder.location V iew  = (TextView)  co nver t V ie w.f i nd V iew By I d(R . i d.location);
          ho l de r.reported D ate Vi ew = (T extView ) con v ertView .findView ById(R.id .t ime) ; 
          convertV iew.setTa g (hold e r) ;

      } e ls e { 
         ho lder= (Vie wH older)  conv er tView.ge tTag();
        }
          hold er. titleView .se t Tex t(listDat a.ge t(position ).g etT itle( ));         hol d er.au thor V iew.setTe x t( lis t D at a.get(posit i o n ).g etAut hor ( ));
          holder.desc r iptionView.set Text ( l ist Dat a .get (p osition).getDe scr ip t i on());
          ho lder.loc at i onVie w.setT ext(li stData. g e t( 
 
public_class CustomArrayAdapter_extends BaseAdapter{

  _ private_List<EventItem>_listData;

 __ private LayoutInflater_layoutInflater;

  _ private Context context;

_  _static_class ViewHolder {
        TextView titleView;
  __ ___TextView descriptionView;
   _    TextView_authorView;
 _      TextView reportedDateView;
__  _   TextView locationView;
    _   ImageView favorite;
 _  }

___ public CustomArrayAdapter(Context context,_List<EventItem> listData) {
   _    this.context =_context;
      _ this.listData = listData;
  _    _Collections.sort(listData);
 _  }

  _ @Override
 _ _public int getCount()_{
     _  return_listData.size();
    }

 __ @Override
 ___public Object_getItem(int position) {
__ __   return listData.get(position);
 __ }

    @Override
 _  public long_getItemId(int_position) {
  _    _return position;
    }

_ _ public_View getView(final int position, View convertView, ViewGroup parent) {
  _     final_ViewHolder holder;
  _ __  if_(convertView_== null)_{
      _ _   layoutInflater = (LayoutInflater)_this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   __     _ convertView = layoutInflater.inflate(R.layout.list_event_item, null);
 _    ___   holder =_new ViewHolder();

    _  _    holder.titleView = (TextView)_convertView.findViewById(R.id.title);
_     __    holder.authorView =_(TextView)_convertView.findViewById(R.id.author);
_    _     _holder.descriptionView = (TextView) convertView.findViewById(R.id.description);
     _  _   holder.locationView =_(TextView)_convertView.findViewById(R.id.location);
_         _ holder.reportedDateView_= (TextView) convertView.findViewById(R.id.time);

_         _ convertView.setTag(holder);

     _  } else {
      _     holder = (ViewHolder)_convertView.getTag();
      _ }
  __      __holder.titleView.setText(listData.get(position).getTitle());
__  _  _  _ holder.authorView.setText(listData.get(position).getAuthor());
_  _ _  __  holder.descriptionView.setText(listData.get(position).getDescription());
            holder.locationView.setText(listData.get(