UMAR-MOBITSOLUTIONS
UMAR-MOBITSOLUTIONS

Reputation: 78004

notifyDataSetChanged(); source not found exception?

friends,

i have problem in calling notifydatasetchanged(); it is giving me exception source not found can any one guide me what mistake am i doing? if i assign data on create it works fine. but in case of updating list it wont.

any help would be appriciated.

private static EfficientAdapter adap; //global variable

 @Override
      public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
        setContentView(R.layout.listsearched);
if(filevalue== "true")
{
    adap = new EfficientAdapter(this);
setListAdapter(adap);


}


}
  private static void RefreshList()
      {
        data = new String[DalMapSearch.MyPassableObject.size()];
        TitleString=new String[DalMapSearch.MyPassableObject.size()];
        DetailString=new String[DalMapSearch.MyPassableObject.size()];

        int i=0;
        for (DalMapSearch t : DalMapSearch.MyPassableObject)
         {
            data[i]= t.getAd_id();
            TitleString[i]= t.getAd_text();
            DetailString[i]=t.getLocation();
            i=i+1;
         }


        adap.notifyDataSetChanged();

      }

Upvotes: 0

Views: 556

Answers (1)

f0rz
f0rz

Reputation: 1565

If you outcomment if(filevalue== "true") , is it the same result (source not found) ? Be sure that you dont calling RefreshList() if the adapter isnt set. For exampel if your fileValue == "false" when oncreate the adapter wouldnt be created.

Upvotes: 1

Related Questions