title: Android client server won't show object
body: <p>I made simple Client server to android.
  I have problem when I send an object from server to the client.
  The object is received ok and when I check the log, it shows me the the object was sent successfully.</p>
  
  <p>The problem occurs when I'm trying to get this object and put it in my <code>ListView</code> adapter.
  The adapter works, I checked it with a random <code>ArrayList</code> I created.
  My issue is when I'm trying to to put the values of <code>AsyncTask</code> in my adapter.</p>
  
  <pre><code>public class RestaurantListFragment extends Fragment {
  
      private ArrayList&lt;Resturant&gt; res = new ArrayList&lt;&gt;();
      private ListAdapter adapter;
      private Firebase restRef = new Firebase("https://restmeup.firebaseio.com/restaurants");
      private Client mClient;
    //  private connectTask  t = (connectTask)new connectTask().execute();
  
  
      public RestaurantListFragment() {
          // Required empty public constructor
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          new connectTask().execute();    
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
     //     new connectTask(getView()).execute();
          final View rootView = inflater.inflate(R.layout.fragment_two, container, false);    
  
          ListView restaurantList = (ListView) rootView.findViewById(R.id.list);
  
          adapter = new ListAdapter(getContext(), res, getActivity());
          restaurantList.setAdapter(adapter);
  
         // connectTask  t = (connectTask)new connectTask().execute();
          if (mClient != null) {
              mClient.sendMessage("bar");
          }
          SqlQueriesConverter sql = new SqlQueriesConverter();
          sql.getResurantsListQuery("bar");
          //       sql.getUserFavoritesResturants(accessToken.getUserId());
          mClient.sendMessage(sql.getQuery());
          //   t.setArray(res);
  
  
          mClient.sendMessage("/quit");
          mClient.stopClient();
  
          final EditText searchText = (EditText)rootView.findViewById(R.id.searchListView);
  
          searchText.addTextChangedListener(new TextWatcher() {
              @Override
              public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                  System.out.println("Before---------");
              }
              @Override
              public void onTextChanged(CharSequence s, int start, int before, int count) {
                  String text = searchText.getText().toString().toLowerCase(Locale.getDefault());
                  adapter.filter(text);
                  adapter.notifyDataSetChanged();
                  System.out.println("array: " + res.toString());
              }
  
              @Override
              public void afterTextChanged(Editable s) {
                  System.out.println("After---------");
              }
          });
  
          // Inflate the layout for this fragment
          return rootView;
      }
  
  
      public class connectTask extends AsyncTask&lt;ArrayList&lt;?&gt;,ArrayList&lt;?&gt;,Client&gt; {
       //   private Client mClient;
          private ArrayList&lt;?&gt; arrayList = new ArrayList&lt;&gt;();
  
          @Override
          protected Client doInBackground(ArrayList&lt;?&gt;... message) {
  
              //we create a Client object and
              mClient = new Client(new Client.OnMessageReceived() {
                  @Override
                  //here the messageReceived method is implemented
                  public void messageReceived(ArrayList&lt;?&gt; message) {
                      //this method calls the onProgressUpdate
                      // publishProgress(message);
                      onProgressUpdate(message);
                  }
              });
  
              mClient.run();
              return null;
          }
  
          // @Override
          protected void onProgressUpdate(ArrayList&lt;?&gt;... values) {
                super.onProgressUpdate(values);
  
              ArrayList&lt;?&gt; arr2;
              if (values[0].get(0) instanceof Resturant){
                  Log.d("step 1", "1");
                  if (((ArrayList&lt;?&gt;)values[0]).get(0)instanceof Resturant) {
  
                      // arr2 = (ArrayList&lt;Resturant&gt;) values[0];
                      res = (ArrayList&lt;Resturant&gt;) values[0];
                      adapter.notifyDataSetChanged();
                      Log.d("array",res.toString());    
  
                  }
              }
              if (values[0].get(0)instanceof Review){
                  arr2 = (ArrayList&lt;Review&gt;) values[0];
              }
              if (values[0].get(0)instanceof UserFavorites){
                  arr2 = (ArrayList&lt;Review&gt;) values[0];
                  Log.d("step 2", "2");
              }    
          }    
      }    
  }
  </code></pre>