title: Getting null pointer exception on interface
body: <p>I wanna pass Arraylist from on class to the class which extends ListFragments.But whenever i call it i am getting null pointer exception.</p>
  
  <p>Async Class</p>
  
  <pre><code>public class SearchJobAsync extends AsyncTask&lt;String, String, String&gt; {
      private String response;
      Context c;
      SearchModel data;
      ArrayList&lt;SearchModel&gt; values;
      getArrayList list;
  
  
      public interface getArrayList {
          public void getList(ArrayList&lt;SearchModel&gt; data);
  
      }
  
      public SearchJobAsync(Context c, ArrayList&lt;SearchModel&gt; values, getArrayList list) {
          this.c = c;
          this.values = values;
          this.list = list;
      }
  
      public SearchJobAsync(Context c) {
          this.c = c;
      }
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute ();
          CommonFunctions.showProgress (c, "Please Wait...", true);
  
      }
  
      @Override
      protected void onPostExecute(String s) {
          values = new ArrayList&lt;SearchModel&gt; ();
  
          super.onPostExecute (s);
          if (!s.trim ().contains ("Table")) {
              Crouton.makeText ((android.app.Activity) c, "Nothing found", Style.INFO).show ();
          } else {
              try {
  
                  JSONObject jsonObject = new JSONObject (s);
                  JSONObject NewDataSet = jsonObject.getJSONObject ("NewDataSet");
                  if (NewDataSet.get ("Table") instanceof JSONObject) {
                      JSONObject table = NewDataSet.getJSONObject ("Table");
                      data = new SearchModel (table.getString ("Job_Category"), table.getString ("Min_Exp"), table.getString ("Max_Exp"), table.getString ("Posted_On"), table.getString ("Candidate_Counts"), table.getString ("Applications"), table.getString ("No_Of_Pos"), table.getString ("Job_Desc"), table.getString ("Job_Type"), table.getString ("Job_Hours"), table.getString ("Job_Status"), table.getString ("Job_Exp_Date"), table.getString ("Address"), table.getString ("Gender_Name"), table.getString ("Religion_Name"), table.getString ("Exp_Summary"), table.getString ("IJob_Request_ID"), table.getString ("Requestor_Name"));
                      values.add (data);
                  } else if (NewDataSet.get ("Table") instanceof JSONArray) {
                      JSONArray tableArray = NewDataSet.getJSONArray ("Table");
  
                      for (int i = 0; i &lt; tableArray.length (); i++) {
                          JSONObject table = tableArray.getJSONObject (i);
                          data = new SearchModel (table.getString ("Job_Category"), table.getString ("Min_Exp"), table.getString ("Max_Exp"), table.getString ("Posted_On"), table.getString ("Candidate_Counts"), table.getString ("Applications"), table.getString ("No_Of_Pos"), table.getString ("Job_Desc"), table.getString ("Job_Type"), table.getString ("Job_Hours"), table.getString ("Job_Status"), table.getString ("Job_Exp_Date"), table.getString ("Address"), table.getString ("Gender_Name"), table.getString ("Religion_Name"), table.getString ("Exp_Summary"), table.getString ("IJob_Request_ID"), table.getString ("Requestor_Name"));
                          values.add (data);
  
                      }
  
                  }
                  if (values.size () &gt; 0) {
                      list.getList (values);
                  }
  
              } catch (JSONException e) {
                  e.printStackTrace ();
              }
          }
  
  
          CommonFunctions.showProgress (c, "", false);
          Intent i = new Intent (c, SearchJobListActivity.class);
          c.startActivity (i);
      }
  
      @Override
      protected String doInBackground(String... s) {
          response = HttpRequest.post ("https://beta135.hamarisuraksha.com/web/WebService/HsJobService.asmx/FindJobForVendor").send ("Vendor_IEntity_Code=" + "34588A34-E969-4723-84FE-E5409B66A5B7" + "&amp;Job_Code=" + "&amp;Job_Category=1" + "&amp;Exp_Years_From=0" + "&amp;Exp_Months_From=0" + "&amp;Exp_Years_To=0" + "&amp;Exp_Months_To=0").body ();
          response = response.replaceAll ("&lt;[^&gt;]*&gt;", "").replaceAll ("\n", "");
          Log.e ("Search Jobs", "" + response);
          return response;
      }
  
  
  }
  </code></pre>
  
  <p>ListFragment Class</p>
  
  <pre><code>public class SearchJobList extends ListFragment implements SearchJobAsync.getArrayList {
      private View view;
      private ListView lvSearchJobs;
      private ArrayList&lt;SearchModel&gt; data;
      SearchJobCustomList customList;
      SearchJobAsync searchJobAsync;
      private Context c;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          view = inflater.inflate (R.layout.search_job_lists, container, false);
          return view;
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated (savedInstanceState);
          c = getActivity ();
          lvSearchJobs = (ListView) getActivity ().findViewById (android.R.id.list);
          data = new ArrayList&lt;SearchModel&gt; ();
          searchJobAsync.execute ();
          searchJobAsync = new SearchJobAsync (c, data, this);
  
  
      }
  
      @Override
      public void getList(ArrayList&lt;SearchModel&gt; data) {
          customList = new SearchJobCustomList (c, data);
          setListAdapter (customList);
      }
  }
  </code></pre>
  
  <p>I m getting error on this lines as said by logcat</p>
  
  <pre><code>list.getList (values);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class SearchJobAsync extends AsyncTask&lt;String, String, String&gt;
  </code></pre>
  
  <p>Logcat</p>
  
  <pre><code>06-26 13:03:46.256  31713-31713/com.jobs_on_call_fragments E/AndroidRuntime﹕ FATAL EXCEPTION: main
      java.lang.NullPointerException
              at com.jobs_on_call_fragments.AsyncTasks.SearchJobAsync.onPostExecute(SearchJobAsync.java:83)
              at com.jobs_on_call_fragments.AsyncTasks.SearchJobAsync.onPostExecute(SearchJobAsync.java:25)
              at android.os.AsyncTask.finish(AsyncTask.java:631)
              at android.os.AsyncTask.access$600(AsyncTask.java:177)
              at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
              at android.os.Handler.dispatchMessage(Handler.java:99)
              at android.os.Looper.loop(Looper.java:213)
              at android.app.ActivityThread.main(ActivityThread.java:4787)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:511)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Other Activity which uses this Async</p>
  
  <pre><code>public class SearchJobsFragment extends Fragment implements View.OnClickListener {
  
      private View view;
      private Spinner spCategory;
      private Button btSearch;
      private Spinner spToYrs;
      private Spinner spFromMonths;
      private Spinner spFromYrs;
      private Spinner spToMonths;
      private EditText etJobCode;
      private String[] yrsArray, monthArray, professionArray;
      private ArrayAdapter&lt;String&gt; toYrs, toMonths, profession;
      private Context c;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          view = inflater.inflate (R.layout.search_jobs_frag, container, false);
          return view;
      }
  
      private void initialize() {
  
          c = getActivity ();
          spCategory = (Spinner) getActivity ().findViewById (R.id.sp_category);
          btSearch = (Button) getActivity ().findViewById (R.id.bt_search);
          spToYrs = (Spinner) getActivity ().findViewById (R.id.sp_to_yrs);
          spFromMonths = (Spinner) getActivity ().findViewById (R.id.sp_from_months);
          spFromYrs = (Spinner) getActivity ().findViewById (R.id.sp_from_yrs);
          spToMonths = (Spinner) getActivity ().findViewById (R.id.sp_to_months);
          etJobCode = (EditText) getActivity ().findViewById (R.id.et_job_code);
          btSearch.setOnClickListener (this);
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated (savedInstanceState);
          initialize ();
          spinnerSetup ();
      }
  
      private void spinnerSetup() {
  
          //for to/from yrs
  
          yrsArray = getResources ().getStringArray (R.array.Experience_yrss);
          toYrs = new ArrayAdapter&lt;String&gt; (c, R.layout.spinner_textview, yrsArray);
          toYrs.setDropDownViewResource (android.R.layout.simple_list_item_single_choice);
          spToYrs.setAdapter (toYrs);
          spFromYrs.setAdapter (toYrs);
  
  
          // for to/from months
          monthArray = getResources ().getStringArray (R.array.Experience_months);
          toMonths = new ArrayAdapter&lt;String&gt; (c, R.layout.spinner_textview, monthArray);
          toMonths.setDropDownViewResource (android.R.layout.simple_list_item_single_choice);
          spToMonths.setAdapter (toMonths);
          spFromMonths.setAdapter (toMonths);
  
  
          //for category
  
          professionArray = getResources ().getStringArray (R.array.Profession);
          Arrays.sort (professionArray, 1, professionArray.length);
          profession = new ArrayAdapter&lt;String&gt; (c, R.layout.spinner_textview, professionArray);
          profession.setDropDownViewResource (android.R.layout.simple_list_item_single_choice);
          spCategory.setAdapter (profession);
  
  
      }
  
      @Override
      public void onClick(View view) {
          SearchJobAsync searchJobAsync = new SearchJobAsync (c);
          searchJobAsync.execute ();
      }
  }
  </code></pre>