Null pointer exception in interface method
<p>This class implements SlideShowListener:<br>
   <code>RestaurantFragment.java</code></p>

<pre><code>public class  RestaurentFragment extends MasterFragment implements SlideShowListener {

    private SlideShowHttpService slideShowHttpService;
   // Remaining code here.

 @Override
    public void onResume() {
        super.onResume();

        if(Util.isNetworkAvailable(mContext)){
            slideShowHttpService = new SlideShowHttpService(mContext);
            slideShowHttpService.mSlideShowListener = this;
        }else{
            CustomSnackBar.display(mContext, "No Connection", "Retry");
  }

 @Override
 public void setSlideShowData(List&lt;ImageSliderPOJO&gt; urlsList, int statusCode) {
        Log.d(TAG," image url "+urlsList.get(0).getImageUrl());
    }

     // Remaining code here.


}
</code></pre>

<p>This class is throwing null pointer exception.<br>
<code>SlideShowHttpService.java</code></p>

<pre><code>  public class SlideShowHttpService {
        private static final String TAG = SlideShowHttpService.class.getSimpleName();
        private Context mContext;
        public SlideShowListener mSlideShowListener;

        public SlideShowHttpService(Context context){
            this.mContext = context;
        }

        public void  parseImageURLLists() {
            if (Util.isNetworkAvailable(mContext)) {
                final ArrayList&lt;ImageSliderPOJO&gt; urlsList = new ArrayList&lt;&gt;();
                FoodRestClient.getURLList("bins/3655b", new AsyncHttpResponseHandler() {
                    @Override
                    public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
                        String response = new String(responseBody);
                        try {

                            JSONArray array = new JSONArray(response);
                            int arraySize = array.length();
                            if (arraySize &gt; 0) {
                                for (int i = 0; i &lt; arraySize; i++) {
                                    JSONObject object = array.getJSONObject(i);
                                    String imageUrl = object.getString("SliderImage");
                                    String targetVendorId = object.getString("TargetVendorId");
                                    urlsList.add(new ImageSliderPOJO(imageUrl, targetVendorId));
                                }
                                mSlideShowListener.setSlideShowData(urlsList, statusCode);     // Null pointer Exception here
                            }
                        } catch (JSONException e) {
                            Log.v(TAG, "json fetch failure " + e.getMessage());
                            mSlideShowListener.setSlideShowData(null, statusCode);
                        }

                    }

                    @Override
                    public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
                        Log.v(TAG, "slideshow http service failure: " + error.getMessage() + " " + statusCode);
                        mSlideShowListener.setSlideShowData(null, statusCode);
                    }
                });

            }
        }

    }
</code></pre>

<p>And This is my interface <code>SlideShowListener.java</code></p>

<pre><code>public interface SlideShowListener {
    void setSlideShowData(List&lt;ImageSliderPOJO&gt; urlsList, int statusCode);
}
</code></pre>

<p>Log Cat error:</p>

<pre><code>FATAL EXCEPTION: main
    Process: com.app.foodmandu, PID: 12051
    java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke interface method 'void com.app.foodmandu.model.listener.SlideShowListener.setSlideShowData(java.util.List, int)' on a null object reference
    at com.loopj.android.http.AsyncHttpResponseHandler.onUserException(AsyncHttpResponseHandler.java:304)
    at com.loopj.android.http.AsyncHttpResponseHandler.handleMessage(AsyncHttpResponseHandler.java:395)
    at com.loopj.android.http.AsyncHttpResponseHandler$ResponderHandler.handleMessage(AsyncHttpResponseHandler.java:510)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5312)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
    Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.app.foodmandu.model.listener.SlideShowListener.setSlideShowData(java.util.List, int)' on a null object reference
    at com.app.foodmandu.view.http.SlideShowHttpService$1.onSuccess(SlideShowHttpService.java:56)
    at com.loopj.android.http.AsyncHttpResponseHandler.handleMessage(AsyncHttpResponseHandler.java:351)
    at com.loopj.android.http.AsyncHttpResponseHandler$ResponderHandler.handleMessage(AsyncHttpResponseHandler.java:510) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:135) 
    at android.app.ActivityThread.main(ActivityThread.java:5312) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:372) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) 
</code></pre>

<p>What am I doing wrong here? why is <code>mSlideShowListener.setSlideShowData()</code> method throwing null pointer exception? I have initialized the <code>mSlideShowListener</code> inside <code>onResume()</code> of <code>RestaurantFragment</code> class</p>