title: ProgessDialog is not shown immediately after clicking on a TextView
body: <p>I am using the following code to show progress dialog on clicking on a TextView:</p>
  
  <pre><code> contacts.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              dialog = new ProgressDialog(GroupChatActivity.this);
              dialog.setMessage("Loading Contacts...");
              dialog.show();
              Toast.makeText(getApplicationContext(), "Contacts Clicked", Toast.LENGTH_SHORT).show();
              popupWindow.dismiss();
              ArrayList&lt;Bean_PhoneNumbers&gt; listBeanPhone = getContactsFromPhone();
              Intent intent = new Intent(GroupChatActivity.this, PhoneBookActivity.class);
              //intent.putExtra("listBeanPhone", listBeanPhone);
              intent.putParcelableArrayListExtra("listBeanPhone", listBeanPhone);
              intent.putExtra("GroupRoomID", roomID);
              Log.e("rID", roomID);
              startActivity(intent);
          }
      });
  </code></pre>
  
  <p>ProgressDialog is dismissed when the activity is destroyed.</p>
  
  <pre><code> protected void onDestroy() {
      super.onDestroy();
      dialog.dismiss();
  }
  </code></pre>
  
  <p>But on clicking contacts ,Progress dialog is not shown immediately ,it is taking too much time .Please help me to fix the issue.</p>