java - how to implement sectioned headers in custom array adapter? -
How can my custom list adapters have section headers which separates list items in my following (date fields) code ?
This is my custom adapter code
Private Class MyCustomAdapter ArrayAdapter and lt; ReportItem & gt; {Private Array List & lt; ReportItem & gt; StateList; Public MyCustomAdapter (Reference Reference, Int TextVRSOSIDID, Arreelist & amp; nbsp; ReportITIM & gt; State List) {Super, (REV, RSOSIDID, State List); This.stateList = New ArrayList & lt; ReportItem & gt; (); This.stateList.addAll (stateList); } Private class viewer {TextView title; Textview City; Textview range; Text view created; Textview tag; } @SuppressLint ("InflateParams") @ Override public view getView (see the status of int, viewview, viewgroup parent) {seeholder holder = null; Logs. V ("ConvertView", string.valouf (status)); If (convertView == faucet) {layout influer vi = (layout inflator) c. Gate system system (reference. LEOUT_INFLATER_SERVICE); Convertview = vi.inflate (R.layout.reports_list_item, null); Holder = new viewholder (); Holder.title = (TextView) ConvertViewfindVBIID (RaidTextView1); Holder.city = (TextView) ConvertViewfWBiID (RaidTextView2); Holder.category = (TextView) ConvertViewedWBIID (R.id.textView3); Holder Created = (text view) ConvertViewFindVBIID (RIDTexView4); Holder = Tags = (TextView) ConvertViewFindVBIID (RTETexView5); ConvertView.setTag (holder); } And {holder = (seeholder) ConvertView.gettag (); } ReportItem County_buzz = ReportsList.Gate (status); Holder.title.setText (removeSpecialChars (county_obj.getTitleP ())); Holder.city.setText (removeSpecialChars (county_obj.getCity ())); Holder.category.setText (removeSpecialChars (county_obj.getCategoryP ())); Holder.created.setText (editTimeFormat (county_obj.getCreatedP ())); Holder.tags.setText (removeSpecialChars (county_obj.getTags ())); Return Convertview; }}
Comments
Post a Comment