title: onPostExecute in Fragment not working (works in Activity)
body: <p>My problem: This code doesn't work in my activity I am trying to implement a gridView adapter that gets data from parse.com</p>
  
  <pre><code>@Override
      protected void onPostExecute(Void result) {
          // Locate the gridview in gridview_main.xml
          gridview = (GridView) findViewById(R.id.gridview);
          // Pass the results into ListViewAdapter.java
          adapter = new GridViewAdapter(MainActivity.this,
                  phonearraylist);
          // Binds the Adapter to the ListView
          gridview.setAdapter(adapter);
          // Close the progressdialog
          mProgressDialog.dismiss();
      }
  }
  }
  </code></pre>
  
  <p>This is within my "DiscoverActivity" class that exteds SherlockFragment</p>
  
  <p>public class DiscoverActivity extends SherlockFragment </p>
  
  <pre><code>// Declare Variables
  GridView gridview;
  List&lt;ParseObject&gt; ob;
  ProgressDialog mProgressDialog;
  ImageAdapter adapter;
  private List&lt;ImageList&gt; phonearraylist = null;
  
  @Override
  public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_discover,container,false);
  //        GridView gridView = (GridView) view.findViewById(R.id.gridview);
   //        gridView.setAdapter(new ImageAdapter(view.getContext())); // uses the view to get the context instead of getActivity().
      new RemoteDataTask().execute();
      return view;
  }
  
  private class RemoteDataTask extends AsyncTask&lt;Void, Void, Void&gt; {
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
  
  //            Toast.makeText(getActivity(), "hello",Toast.LENGTH_LONG).show();
          Toast.makeText(getActivity().getApplicationContext(),"Loading...",Toast.LENGTH_LONG).show();
  
      }
  
  protected Void doInBackground(Void... params) {
      // Create the array
      phonearraylist = new ArrayList&lt;ImageList&gt;();
      try {
          // Locate the class table named "SamsungPhones" in Parse.com
          ParseQuery&lt;ParseObject&gt; query = new ParseQuery&lt;ParseObject&gt;(
                  "testData2");
          // Locate the column named "position" in Parse.com and order list
          // by ascending
          query.orderByAscending("Price");
          ob = query.find();
          for (ParseObject country : ob) {
              ParseFile image = (ParseFile) country.get("Photo");
              ImageList map = new ImageList();
              map.setPhone(image.getUrl());
              phonearraylist.add(map);
          }
      } catch (ParseException e) {
          Log.e("Error", e.getMessage());
          e.printStackTrace();
      }
      return null;
  }
  
  //Here is what I have tried so far...
  @Override
  protected void onPostExecute(Void result) {
      // Locate the gridview in gridview_main.xml
      gridview = (GridView) findViewById(R.id.gridview);
      // Pass the results into ListViewAdapter.java
      //adapter = new ImageAdapter(DiscoverActivity.this,
        //      phonearraylist);
      GridView gridView = (GridView) view.findViewById(R.id.gridview);
      gridView.setAdapter(new ImageAdapter(view.getContext())); // uses the view to get the context instead of getActivity().
      // Binds the Adapter to the ListView
      gridview.setAdapter(adapter);
      // Close the progressdialog
      mProgressDialog.dismiss();
  }
  }
  }
  </code></pre>
  
  <p>I am undable to findViewById in my onPostExecute</p>
  
  <p>Thanks in advance for any help you can give me!</p>