title: How to check if Listview is empty
body: <p>My activity queries my parse database and then reuturns data as queried. The data is stored in terms of names in the listview. But I cant figure out how to check if the listview is empty. I want it to post an alert saying the list view is empty under the event it is. This is my activity</p>
  
  <pre><code>public class OfferPage extends Activity {
      String obj;
      ProgressDialog mProgressDialog;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_offer_page);
  
          Intent i = getIntent();
          obj = i.getStringExtra("RestName");
          populateList(obj, "Restraunt");
  
      }
  
      private void populateList(final String Value, final String Key) {
          ParseQueryAdapter.QueryFactory&lt;ParseObject&gt; factory = new ParseQueryAdapter.QueryFactory&lt;ParseObject&gt;() {
  
              @Override
              @SuppressWarnings({ "unchecked", "rawtypes" })
              public ParseQuery create() {
                  ParseQuery query = new ParseQuery("Offers");
                  query.whereEqualTo(Key, Value);
                  return query;
              }
          };
          ParseQueryAdapter&lt;ParseObject&gt; adapter = new ParseQueryAdapter&lt;ParseObject&gt;(
                  this, factory);
          adapter.setTextKey("Offer");
          adapter.addOnQueryLoadListener(new OnQueryLoadListener&lt;ParseObject&gt;() {
  
              @Override
              public void onLoading() {
                  mProgressDialog = new ProgressDialog(OfferPage.this);
                  mProgressDialog.setTitle("Searching for Offers");
                  mProgressDialog.setMessage("Loading...");
                  mProgressDialog.setIndeterminate(false);
                  mProgressDialog.show();
              }
  
              @Override
              public void onLoaded(List&lt;ParseObject&gt; objects, Exception e) {
                  mProgressDialog.dismiss();
              }
          });
  
          final ListView listView = (ListView) findViewById(R.id.offerList);
          listView.setAdapter(adapter);
      }
  </code></pre>
  
  <p>My main issue I cant seem to figure out where to put the check if the list is empty. Any suggestions?</p>