Still stuck on JSONParsing issue
<p>I am stuck and gone crazy to resolve this issue but no luck with me. I tried all the guidelines that SO member giving me as i had asked this question before:( Thank all of you who respond. I search alot to resolve it but never succeed last hope is SO, so Kindly guide me where I go wrong and how can I resolve this JSONParsing? I posted data from PHP and want to get it on android EditText boxes. I code it but there are some issue which exist from the day one and not resolved yet. I got different LogCat errors on emulator and on Phone. I have posed you my java code and LogCat errors. Any guide will be precious for me.</p>

<p>my Java code is where i got errors:</p>

<pre><code>// save button
    btnSave = (Button) findViewById(R.id.btnSave);

    // getting product details from intent
    Intent i = getIntent();

    // getting product id (pid) from intent
    cid = i.getStringExtra(TAG_CID);

    // save button click event
    btnSave.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // starting background task to update product
            new SaveTaskDetails().execute();
        }
    });

    }

@Override
protected void onStart() {
  super.onStart();
   // Getting complete product details in background thread
  new GetTaskDetails().execute();
}

/**
 * Background Async Task to Get complete product details
 * */
class GetTaskDetails extends AsyncTask&lt;String, String, JSONObject&gt; {

    /**
     * Before starting background thread Show Progress Dialog
     * */


    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        tDialog = new ProgressDialog(My_Task.this);
        tDialog.setTitle("Please Wait");
        tDialog.setMessage("Retrieving Task Details.");
        tDialog.setIndeterminate(false);
        tDialog.setCancelable(true);
        tDialog.show();

    }

    /**
     * Getting task details in background thread
     * @return 
     **/

   protected JSONObject doInBackground(String... params1) {

      JSONObject my_task = null;
           // updating UI from Background Thread
                  // Check for success tag
                int success;
                try {
                    // Building Parameters
                    List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
                    params.add(new BasicNameValuePair("cid", cid));

                    // getting product details by making HTTP request
                    // Note that product details url will use GET request
                    JSONObject json = JSONParser.makeHttpRequest(
                            url_read_mytask, "GET", params);

                    // check your log for json response
     //                Log.d("Single Task Details", json.toString());

                    // json success tag
                    success = json.getInt(TAG_SUCCESS);
                    if (success == 1) {
                        // successfully received product details
                        JSONArray my_taskObj = json
                                .getJSONArray(TAG_MYTASK); // JSON Array

                        // get first product object from JSON Array
                       my_task = my_taskObj.getJSONObject(0);

                         }
                    else
                    {
                        // task with cid not found

                    }
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                }


        return my_task;
    }

    /**
     * After completing background task Dismiss the progress dialog
     * **/


    protected void onPostExecute(JSONObject my_task) {
        // dismiss the dialog once got all details
        cus_name_txtbx = (EditText) findViewById(R.id.cus_name_txtbx);
        try {
            cus_name_txtbx.setText(my_task.getString(TAG_NAME));
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        contact_no_txtbx = (EditText) findViewById(R.id.contact_no_txtbx);
        try {
            contact_no_txtbx.setText(my_task.getString(TAG_CONTACT));
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        ticket_no_txtbx = (EditText) findViewById(R.id.ticket_no_txtbx);
        try {
            ticket_no_txtbx.setText(my_task.getString(TAG_TICKET));
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        task_detail_txtbx = (EditText) findViewById(R.id.task_detail_txtbx);
        try {
            task_detail_txtbx.setText(my_task.getString(TAG_TASKDETAIL));
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }           

        tDialog.dismiss(); 
    }
}

/**
 * Background Async Task to  Save product Details
 * */
class SaveTaskDetails extends AsyncTask&lt;String, String, String&gt; {

    /**
     * Before starting background thread Show Progress Dialog
     * */
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        tDialog = new ProgressDialog(My_Task.this);
        tDialog.setTitle("Please Wait");
        tDialog.setMessage("Saving Task");
        tDialog.setIndeterminate(false);
        tDialog.setCancelable(true);
        tDialog.show();
    }

    /**
     * Saving product
     * */
    protected String doInBackground(String... args) {

        // getting updated data from EditTexts
        String cus_name = cus_name_txtbx.getText().toString();
        String contact_no = contact_no_txtbx.getText().toString();
        String ticket_no = ticket_no_txtbx.getText().toString();
        String task_detail = task_detail_txtbx.getText().toString();

        // Building Parameters
        List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
        params.add(new BasicNameValuePair(TAG_CID, cid));
        params.add(new BasicNameValuePair(TAG_NAME, cus_name));
        params.add(new BasicNameValuePair(TAG_CONTACT, contact_no));
        params.add(new BasicNameValuePair(TAG_TICKET, ticket_no));
        params.add(new BasicNameValuePair(TAG_TASKDETAIL, task_detail));

        // sending modified data through http request
        // Notice that update product url accepts POST method
        JSONObject json = JSONParser.makeHttpRequest(url_update_mytask,
                "POST", params);

        // check json success tag
        try {
            int success = json.getInt(TAG_SUCCESS);

            if (success == 1) {
                // successfully updated
                Intent i = getIntent();
                // send result code 100 to notify about product update
                setResult(100, i);
                finish();
            } else {
                // failed to update product
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    /**
     * After completing background task Dismiss the progress dialog
     * **/
    protected void onPostExecute(String file_url) {
        // dismiss the dialog once product uupdated
        tDialog.dismiss();
    }
}
</code></pre>

<p>My Logcat errors are:</p>

<pre><code>    01-01 11:28:52.549: E/WindowManager(31782):     at java.lang.reflect.Method.invokeNative(Native Method)
01-01 11:38:15.149: E/WindowManager(1133): Activity com.example.visit.record.My_Task has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4054ce88 that was originally added here
01-01 11:38:15.149: E/WindowManager(1133): android.view.WindowLeaked: Activity com.example.visit.record.My_Task has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4054ce88 that was originally added here
01-01 11:38:15.149: E/WindowManager(1133):  at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:277)
01-01 11:38:15.149: E/WindowManager(1133):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
01-01 11:38:15.149: E/WindowManager(1133):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
01-01 11:38:15.149: E/WindowManager(1133):  at android.view.Window$LocalWindowManager.addView(Window.java:433)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.Dialog.show(Dialog.java:288)
01-01 11:38:15.149: E/WindowManager(1133):  at com.example.visit.record.My_Task$GetTaskDetails.onPreExecute(My_Task.java:139)
01-01 11:38:15.149: E/WindowManager(1133):  at android.os.AsyncTask.execute(AsyncTask.java:391)
01-01 11:38:15.149: E/WindowManager(1133):  at com.example.visit.record.My_Task.onStart(My_Task.java:118)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1225)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.Activity.performStart(Activity.java:3941)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1794)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1842)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.ActivityThread.access$1500(ActivityThread.java:132)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
01-01 11:38:15.149: E/WindowManager(1133):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 11:38:15.149: E/WindowManager(1133):  at android.os.Looper.loop(Looper.java:143)
01-01 11:38:15.149: E/WindowManager(1133):  at android.app.ActivityThread.main(ActivityThread.java:4268)
01-01 11:38:15.149: E/WindowManager(1133):  at java.lang.reflect.Method.invokeNative(Native Method)
01-01 11:38:15.149: E/WindowManager(1133):  at java.lang.reflect.Method.invoke(Method.java:507)
01-01 11:38:15.149: E/WindowManager(1133):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-01 11:38:15.149: E/WindowManager(1133):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-01 11:38:15.149: E/WindowManager(1133):  at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>Kindly guide.
I got an error on       <strong>new GetTaskDetails().execute();</strong> and on  <code>**tDialog.show();**</code> on PreExecute of GetTaskDetails Class</p>
