title explains it yet i would like to explain more;
I have a list view which all items have orange background. To say it simple: when one item is clicked it turns its background to blue. When another is clicked last clicked should be blue, previous should go to be orange with others.To make it happen, in single a row , i got 2 layouts(blue and orange)
and on click , i make blue layout(llTicketViewOnClickContainer)
visible.
not just background colour , it has buttons,images etc , i just wanted to simply explain it.
now the code below , its from the adapter which we use for list view
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final TicketViewDataObject item=ticketViewObjects.get(position);
if(convertView==null){
convertView = inflater.inflate( R.layout.companyviewlibrary_listview_row_ticketview , parent,false);
}else{
}
ticketView=(TicketView) convertView;
final View clicked=ticketView.findViewById(R.id.llTicketViewOnClickContainer);
ticketView.prepareTicketView(item);
if(item.isClicked())
clicked.setVisibility(View.VISIBLE);
else
clicked.setVisibility(View.GONE);
ticketView.setOnClickListener(new OnClickListener() {
for (TicketViewDataObject item : ticketViewObjects) {
item.setClicked(false);
}
long timeStart =System.currentTimeMillis();
refreshList();
Log.e("TIME_POPULATE",""+(System.currentTimeMillis()-timeStart) );
}
for the refreshList function
public void refreshList(){
this.notifyDataSetChanged();
}
now my problem is when i use notifyDataSetChanged
, it changes all data, clears and updates(tries to get images again which is our problem)
, refills again.
i just wanted to change previous clicked item's llTicketViewOnClickContainer
visibility.