title: NoSuchMethodError:com.android.app.fragment getContext in android
body: <p>Am getting this error for php webservices in GridView category and category images are in  array list I have to display them in grid view thrpough web services But error has been occured in getData() as NoSuchMethodError 
  please try to help me Thanks in advance.</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.activity_customerhomepage, container, false);
      gridView = (GridView) rootView.findViewById(R.id.gridView);
      ids = new ArrayList&lt;&gt;();
      categorys = new ArrayList&lt;&gt;();
      category_imgs = new ArrayList&lt;&gt;();
  
      //Calling the getData method
      getData();
      return rootView;
  }
  
  private void getData() {
  
      final ProgressDialog loading = ProgressDialog.show(getContext(), "Please wait...", "Fetching data...", false, false);
  
      //Creating a json array request to get the json from our api
      JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(DATA_URL,
              new Response.Listener&lt;JSONArray&gt;() {
                  @Override
                  public void onResponse(JSONArray response) {
                      //Dismissing the progressdialog on response
                      loading.dismiss();
  
                      //Displaying our grid
                      showGrid(response);
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
  
                  }
              }
      );
  </code></pre>
  
  <p>Logcat Error:</p>
  
  <pre><code>    03-20 22:35:58.002 23736-23736/? E/AndroidRuntime: FATAL EXCEPTION: main
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime: Process: com.android.app.a2aapp, PID: 23736
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime: java.lang.NoSuchMethodError: com.android.app.a2aapp.HomeFragment.getContext
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at com.android.app.a2aapp.HomeFragment.getData(HomeFragment.java:67)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at com.android.app.a2aapp.HomeFragment.onCreateView(HomeFragment.java:61)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.Fragment.performCreateView(Fragment.java:1700)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.BackStackRecord.run(BackStackRecord.java:684)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.Activity.performStart(Activity.java:5257)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2171)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.ActivityThread.access$800(ActivityThread.java:139)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:136)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5086)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  03-20 22:35:58.002 23736-23736/? E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>