views:

182

answers:

1

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();

      }
+1  A: 

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.

f0rz
yes , actually in case of else it was not setting adap to listview and it was showing error while calling notifydataset changed.
UMMA