How to know where is the issue in android coding
<p>I am new in android and i have assigned a project.I am facing problem to find issue while going through error log.Here is my error log please tell me what is this issue and how it could be resolved</p>

<pre><code>03-13 12:40:06.470: E/WindowManager(923): android.view.WindowLeaked: Activity  om.example.mytest.ReadContactsActivity has leaked window   com.android.internal.policy.impl.PhoneWindow$DecorView{40d0e768 V.E..... R.....ID 0,0-97,92} that was originally added here
03-13 12:40:06.470: E/WindowManager(923):   at android.view.ViewRootImpl.&lt;init&gt;(ViewRootImpl.java:354)
03-13 12:40:06.470: E/WindowManager(923):   at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:216)
03-13 12:40:06.470: E/WindowManager(923):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.Dialog.show(Dialog.java:281)
03-13 12:40:06.470: E/WindowManager(923):   at com.example.mytest.ReadContactsActivity$CountDownTask.onPreExecute(ReadContactsActivity.java:50)
03-13 12:40:06.470: E/WindowManager(923):   at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
03-13 12:40:06.470: E/WindowManager(923):   at android.os.AsyncTask.execute(AsyncTask.java:534)
03-13 12:40:06.470: E/WindowManager(923):   at com.example.mytest.ReadContactsActivity.onCreate(ReadContactsActivity.java:34)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.Activity.performCreate(Activity.java:5104)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-13 12:40:06.470: E/WindowManager(923):   at android.os.Handler.dispatchMessage(Handler.java:99)
03-13 12:40:06.470: E/WindowManager(923):   at android.os.Looper.loop(Looper.java:137)
03-13 12:40:06.470: E/WindowManager(923):   at android.app.ActivityThread.main(ActivityThread.java:5039)
03-13 12:40:06.470: E/WindowManager(923):   at java.lang.reflect.Method.invokeNative(Native Method)
03-13 12:40:06.470: E/WindowManager(923):   at java.lang.reflect.Method.invoke(Method.java:511)
03-13 12:40:06.470: E/WindowManager(923):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-13 12:40:06.470: E/WindowManager(923):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-13 12:40:06.470: E/WindowManager(923):   at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>Here is the code which i wrote to achieve</p>

<pre><code> private class CountDownTask extends AsyncTask&lt;Void, String, Void&gt;{


    // A callback method executed on UI thread on starting the task
    @Override
    protected void onPreExecute() {
        // Getting reference to the TextView tv_counter of the layout activity_main
        dialog = new Dialog(ReadContactsActivity.this);
        dialog.setCancelable(false);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(R.layout.progressdialog);

        progressBar = (ProgressBar) dialog.findViewById(R.id.progressBar1);
        dialog.show();


    }

    // A callback method executed on non UI thread, invoked after 
    // onPreExecute method if exists

    protected Void doInBackground(Void... params) {
         ContentResolver cr = ReadContactsActivity.this.getContentResolver();
         Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,
                null, null, null, null);

         if (cur.getCount() &gt; 0) {
             while (cur.moveToNext()) {
                 String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
                 String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
                 if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {
                     Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,
                                            ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",
                                            new String[]{id}, null);
                     while (pCur.moveToNext()) {
                           String phone = pCur.getString(
                                  pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                           objItem = new listBean();
                        objItem.setName(name);
                        objItem.setNumber(phone);
                        listArray.add(objItem);
                     }
                     pCur.close();
                     }
                 }
             }
        return null;
    }


    // A callback method executed on UI thread, invoked by the publishProgress() 
    // from doInBackground() method
    @Override
    protected void onProgressUpdate(String... values) {

    }


    @Override
    protected void onPostExecute(Void result) {
        dialog.dismiss();
        objAdapter = new listAdapter(ReadContactsActivity.this, items);
        listView.setAdapter(objAdapter);

        }   
</code></pre>
