ListView getChildAt returning null etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
ListView getChildAt returning null etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

10 Mayıs 2016 Salı

parent.getChildAt(positon) returns null visible child çözüldü

listview.getChildAt(positon) returns null  hatasının çözümü

Aşağıdaki kodu listivew içinde yazın

View view;

int firstPos = listview.getFirstVisiblePosition();
int wantedPos = position - firstPos;

if ((wantedPos >= 0) && (wantedPos <= listview.getChildCount())
{
 view =listview.getChildAt(wantedPos);
 if (view == null){
  return;}
else{
 //  burada  view ' ı kullanın  }
}