title: Cannot resolve method getApplicationContext()
body: <p>This is the code I got from internet which I need it for my own application. I am trying to make an app using the example. The difference is that I made one separate class for this named <code>JSONTask</code>. I am getting error with <code>getApplicationContex()</code> function. Please help me with this.</p>
  
  <pre><code>import android.os.AsyncTask;
  import android.widget.ListView;
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  import navdrawerexample1.models.MovieModel;
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.util.ArrayList;
  import java.util.List;
  
  public class JSONTask extends AsyncTask&lt;String,String,List&lt;MovieModel&gt;&gt;
  {
  private ListView lvMovies;
  @Override
  protected List&lt;MovieModel&gt; doInBackground(String... params) {
      HttpURLConnection connection = null;
      BufferedReader reader = null;
      try {
          URL url= new URL(params[0]);
          connection = (HttpURLConnection) url.openConnection();
          connection.connect();
  
  
          InputStream stream = connection.getInputStream();
          reader = new BufferedReader(new InputStreamReader(stream));
          StringBuffer buffer = new StringBuffer();
          String line ="";
          while ((line = reader.readLine())!=null){
              buffer.append(line);
          }
          String finalJason = buffer.toString();
  
          JSONObject parentObject = new JSONObject(finalJason);
          JSONArray parentArray = parentObject.getJSONArray("movies");
  
          List&lt;MovieModel&gt; movieModelList = new ArrayList&lt;&gt;();
          //StringBuffer finalBufferData = new StringBuffer();
          for (int i=0; i&lt;parentArray.length();i++) {
              JSONObject finalObject = parentArray.getJSONObject(i);
              MovieModel movieModel = new MovieModel();
              movieModel.setMovie(finalObject.getString("movie"));
              movieModel.setYear(finalObject.getInt("year"));
              movieModel.setRating((float) finalObject.getDouble("rating"));
              movieModel.setDuration(finalObject.getString("duration"));
              movieModel.setDirector(finalObject.getString("director"));
              movieModel.setTagline(finalObject.getString("tagline"));
              movieModel.setImage(finalObject.getString("image"));
              movieModel.setStory(finalObject.getString("story"));
  
              List&lt;MovieModel.cast&gt; castList = new ArrayList&lt;&gt;();
              for (int j=0; j&lt;finalObject.getJSONArray("cast").length();j++){
                  MovieModel.cast cast = new MovieModel.cast();
                  cast.setName(finalObject.getJSONArray("cast").getJSONObject(j).getString("name"));
                  castList.add(cast);
              }
              movieModel.setCastList(castList);
              //adding the final object in the list
              movieModelList.add(movieModel);
          }
          return  movieModelList;
  
      } catch (MalformedURLException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      } catch (JSONException e) {
          e.printStackTrace();
      } finally {
          if (connection != null) {
              connection.disconnect();
          }
          try {
              if (reader != null) {
                  reader.close();
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
      return null;
  }
  
  @Override
  protected void onPostExecute(List&lt;MovieModel&gt; result) {
      super.onPostExecute(result);
      //This is where I get the error
      MovieAdapter adapter = new MovieAdapter(getApplicationContext(),R.layout.row,result);
      lvMovies.setAdapter(adapter);
      //TODO need to set data to the list
  }
  </code></pre>
  
  <p>}</p>