title: Undefined ProgressDialog in current activity
body: <p>I am working on my app and I have the ProgressDialog method inside of my fragment and for some reason it saying that the acticity I am passing through to the ProgressDialog is undefined. To me it doesnt make since because im using the activityname.this which should just say you are point to the current activity, am I correct? What am I doing wrong?</p>
  
  <pre><code>Here is the errors i am getting
  No enclosing instance of the type MainActivity is accessible in scope   FragmentHome.java   /SideMenuTabs/src/com/begin/sidemenutabs    line 98 Java Problem
  
  The constructor ProgressDialog(FragmentHome.DownloadJSON) is undefined  FragmentHome.java   /SideMenuTabs/src/com/begin/sidemenutabs    line 54 Java Problem
  
  The method findViewById(int) is undefined for the type FragmentHome.DownloadJSON    FragmentHome.java   /SideMenuTabs/src/com/begin/sidemenutabs    line 96 Java Problem
  </code></pre>
  
  <p>The parts that say undefined are.</p>
  
  <p>The line 5 on this.</p>
  
  <pre><code>protected void onPreExecute() {
      super.onPreExecute();
      // Create a progressdialog
      //Undefined error
      mProgressDialog = new ProgressDialog(FragmentHome.this);
      // Set progressdialog title
      mProgressDialog.setTitle("Testing Parse 1");
      // Set progressdialog message
      mProgressDialog.setMessage("Loading...");
      mProgressDialog.setIndeterminate(false);
      // Show progressdialog
      mProgressDialog.show();
  }
  </code></pre>
  
  <p>And line 6 on this one.</p>
  
  <pre><code>    protected void onPostExecute(Void args) {
          // Locate the listview in listview_main.xml
          listview = (ListView) findViewById(R.id.listview);
          // Pass the results into ListViewAdapter.java
          //Undefined error
          adapter = new ListViewAdapter(MainActivity.this, arraylist);
          // Binds the Adapter to the ListView
          listview.setAdapter(adapter);
          // Close the progressdialog
          mProgressDialog.dismiss();
      }
  </code></pre>
  
  <p>This is my whole fragment.</p>
  
  <pre><code>    public class FragmentHome extends SherlockFragment {
  
          private final String TAG = "Home";
          // Parse Declare Variables
          JSONObject jsonobject;
          JSONArray jsonarray;
          ListView listview;
          ListViewAdapter adapter;
          ProgressDialog mProgressDialog;
          ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist;
          static String RANK = "rank";
          static String COUNTRY = "country";
          static String POPULATION = "population";
          static String FLAG = "flag";
  
  
          @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
              Log.i(TAG, "Home Loaded");
              View rootView = inflater.inflate(R.layout.fragmenthome, container, false);
              new DownloadJSON().execute();
              return rootView;
  
          }
  
  // DownloadJSON AsyncTask
      private class DownloadJSON extends AsyncTask&lt;Void, Void, Void&gt; {
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              // Create a progressdialog
              mProgressDialog = new ProgressDialog(FragmentHome.this);
              // Set progressdialog title
              mProgressDialog.setTitle("Testing Parse 1");
              // Set progressdialog message
              mProgressDialog.setMessage("Loading...");
              mProgressDialog.setIndeterminate(false);
              // Show progressdialog
              mProgressDialog.show();
          }
  
  
  
      @Override
          protected Void doInBackground(Void... params) {
              // Create the array 
              arraylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
              // Retrive JSON Objects from the given website URL in JSONfunctions.class
              jsonobject = JSONfunctions.getJSONfromURL("parsingurl");
  
              try {
                  // Locate the array name
                  jsonarray = jsonobject.getJSONArray("worldpopulation");
  
                  for (int i = 0; i &lt; jsonarray.length(); i++) {
                      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                      jsonobject = jsonarray.getJSONObject(i);
                      // Retrive JSON Objects
                      map.put("rank", jsonobject.getString("rank"));
                      map.put("country", jsonobject.getString("country"));
                      map.put("population", jsonobject.getString("population"));
                      map.put("flag", jsonobject.getString("flag"));
                      // Set the JSON Objects into the array
                      arraylist.add(map);
                  }
              } catch (JSONException e) {
                  Log.e("Error", e.getMessage());
                  e.printStackTrace();
              }
              return null;
          }
  
          @Override
          protected void onPostExecute(Void args) {
              // Locate the listview in listview_main.xml
              listview = (ListView) findViewById(R.id.listview);
              // Pass the results into ListViewAdapter.java
              adapter = new ListViewAdapter(MainActivity.this, arraylist);
              // Binds the Adapter to the ListView
              listview.setAdapter(adapter);
              // Close the progressdialog
              mProgressDialog.dismiss();
          }
      }
  
      }
  </code></pre>