title: empty view not display in listview
body: <p>I am trying to <strong>display empty view when no internet connection</strong> give me no internet connection  and display no book when no book is not found </p>
  
  <p><strong>This is my code</strong> </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  private static final String BOOK_REQUEST_URL = "https://www.googleapis.com/books/v1/volumes?q=";
  public static final String LOG_TAG = MainActivity.class.getName();
  // search button
  private Button search_button;
  // edit text to use for search
  private EditText editText;
  // string used to get string from edit text.
  private String queryWord = null;
  private TextView emptyTextView;
  private ListView bookListView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      search_button = (Button) findViewById(R.id.next_button);
      editText = (EditText) findViewById(R.id.edit_text);
      emptyTextView = (TextView) findViewById(R.id.empty_view);
  
      bookListView = (ListView) findViewById(R.id.list_view);
  
      // Get a reference to the ConnectivityManager to check state of network connectivity
      ConnectivityManager connMgr = (ConnectivityManager)
              getSystemService(Context.CONNECTIVITY_SERVICE);
  
      // Get details on the currently active default data network
      final NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
  </code></pre>
  
  <p><strong>here I want when not connection give me no internet connection`</strong></p>
  
  <pre><code> search_button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              if (networkInfo != null &amp;&amp; networkInfo.isConnected()) {
  
                  new GetBook().execute(BOOK_REQUEST_URL);
              } else {
  
                  emptyTextView.setText(R.string.NoConnect);
                  bookListView.setEmptyView(emptyTextView);
  
              }
          }
  
      });
      new GetBook().execute(BOOK_REQUEST_URL);
  }
  //  method to get string from edit text.
  public String getBook() {
      queryWord = editText.getText().toString();
      if (queryWord == null) {
          bookListView.setEmptyView(emptyTextView);
      }
      return queryWord;
  }
  
  /**
   * Update the UI with the given book information.
   */
  private void updateUi(List&lt;Book&gt; books) {
  
      // Find a reference to the {@link ListView} in the layout
  
      // Create a new {@link ArrayAdapter} of book
      final BookAdapter adapter = new BookAdapter(this, books);
  
      // Set the adapter on the {@link ListView}
      // so the list can be populated in the user interface
      bookListView.setAdapter(adapter);
  
  }
  // inner class for to support methods do in the background.
  private class GetBook extends AsyncTask&lt;String, Void, List&lt;Book&gt;&gt; {
  
      @Override
      protected List&lt;Book&gt; doInBackground(String... urls) {
          String word_search = getBook();
          // Don't perform the request if there are no URLs, or the first URL is null.
          if (urls.length &lt; 1 || urls[0] == null) {
              return null;
          }
          List&lt;Book&gt; result = QueryUtils.fetchBookName(urls[0], word_search);
          return result;
      }
  
      /**
       * This method is invoked on the main UI thread after the background work has been
       * completed.
       * &lt;p&gt;
       * It IS okay to modify the UI within this method. We take the {@link Book} object
       * (which was returned from the doInBackground() method) and update the views on the screen.
       */
  </code></pre>
  
  <p><strong>here I want to display no list book</strong></p>
  
  <pre><code>    @Override
          protected void onPostExecute(List&lt;Book&gt; book) {
  
              emptyTextView.setText(R.string.nobook);
              bookListView.setEmptyView(emptyTextView);
  
              // Hide loading indicator because the data has been loaded
              View loadingIndicator = findViewById(R.id.loading_indicator);
              loadingIndicator.setVisibility(View.GONE);
              if ((book != null) &amp;&amp; !book.isEmpty()) {
                  updateUi(book);
              }
  
          }
      }
  }
  </code></pre>
  
  <p>I try more steps nothing happen</p>