title: FATAL EXCEPTION: AsyncTask #1 , java.lang.RuntimeException: An error occured while executing doInBackground()
body: <p>i had error when build my code on android device. 
  its the error report</p>
  
  <blockquote>
    <p>05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime: Process: com.example.ckw.mapku, PID: 17982
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime: java.lang.RuntimeException: An error occured while executing doInBackground()
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at android.os.AsyncTask$3.done(AsyncTask.java:300)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:841)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:  Caused by: java.lang.NullPointerException
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at com.example.ckw.mapku.ServiceHandler.makeHttpRequest(ServiceHandler.java:71)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at com.example.ckw.mapku.ServiceHandler.makeHttpRequest(ServiceHandler.java:33)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at com.example.ckw.mapku.Hasil_pencarian$GetMedik.doInBackground(Hasil_pencarian.java:77)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at com.example.ckw.mapku.Hasil_pencarian$GetMedik.doInBackground(Hasil_pencarian.java:60)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at android.os.AsyncTask$2.call(AsyncTask.java:288)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
    05-17 09:47:16.035 17982-18134/com.example.ckw.mapku E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:841)</p>
  </blockquote>
  
  <p>and this is my code</p>
  
  <pre><code>    package com.example.ckw.mapku;
  
  import android.app.ProgressDialog;
  import android.app.Service;
  import android.os.AsyncTask;
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Log;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ListAdapter;
  import android.widget.ListView;
  import android.widget.SimpleAdapter;
  import android.widget.TextView;
  
  import org.apache.http.HttpEntity;
  import org.apache.http.HttpRequest;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.params.BasicHttpParams;
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  import org.json.JSONStringer;
  
  import java.io.BufferedReader;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  import java.util.HashMap;
  public class Hasil_pencarian extends AppCompatActivity {
  
      String myJSON;
  
      private static final String TAG_RESULT = "result";
      private static final String TAG_ID = "id_lay";
      private static final String TAG_NAME = "Nama";
      private static final String TAG_LONG = "Longitude";
      private static final String TAG_LAT = "Latitude";
  
      JSONArray layanan = null;
  
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; layananList;
  
      ListView list;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_hasil_pencarian);
          list = (ListView) findViewById(R.id.listView);
          layananList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
          new GetMedik().execute();
      }
  
      private  class GetMedik extends AsyncTask&lt;String, Void, JSONObject&gt;{
          private ProgressDialog progressDialog;
  
          private static final String ALAMAT = "http://rugimuleh.com/medikmap/medik.php";
  
          @Override
          protected void onPreExecute(){
              progressDialog = new ProgressDialog(Hasil_pencarian.this);
              progressDialog.setMessage("Tunggu sebentar...");
              progressDialog.setCancelable(false);
              progressDialog.show();
  
          }
  
          @Override
          protected JSONObject doInBackground(String... arg0) {
              ServiceHandler sh = new ServiceHandler();
              JSONObject jsonStr = sh.makeHttpRequest(ALAMAT, "GET");
              Log.d("JSON result ", jsonStr.toString());
              myJSON = jsonStr.toString();
  
              if (jsonStr != null) {
                  try {
                      JSONObject jsonObject = new JSONObject(myJSON);
                      layanan = jsonObject.getJSONArray(TAG_RESULT);
  
                      for (int i=0;i&lt;layanan.length();i++){
                          JSONObject c = layanan.getJSONObject(i);
                          String id_lay = c.getString(TAG_ID);
                          String Nama = c.getString(TAG_NAME);
                          String Longitude = c.getString(TAG_LONG);
                          String Latitude = c.getString(TAG_LAT);
  
                          HashMap&lt;String, String&gt; medik = new HashMap&lt;String, String&gt;();
  
                          medik.put(TAG_ID, id_lay);
                          medik.put(TAG_NAME, Nama);
                          medik.put(TAG_LONG, Longitude);
                          medik.put(TAG_LAT, Latitude);
  
                          layananList.add(medik);
                      }
                  }catch (Exception e) {
                      e.printStackTrace();
                  }
              }else {
                  Log.e("ServiceHandler", "Couldn't get any data from the url");}
              return null;
          }
  
          protected void onPostExecute(JSONObject result){
              super.onPostExecute(result);
  
              if(progressDialog.isShowing())
                  progressDialog.dismiss();
  
              ListAdapter adapter = new SimpleAdapter(
                      Hasil_pencarian.this, layananList, R.layout.list_item,
                      new String[]{TAG_ID, TAG_NAME, TAG_LONG, TAG_LAT},
                      new  int[]{R.id.id_lay, R.id.Nama, R.id.Longitude, R.id.Latitude}
              );
              list.setAdapter(adapter);
  
          }
      }
  </code></pre>
  
  <p>}</p>