title: How to get application's context in other method than onCreate in Android Studio?
body: <p>I have an async task which eventually creates the parameters email,about. The async task is in the onCreate method, and so is this CustomListAdapter. I want to move the CustomListAdapter from onCreate in the asyncTask in <code>onPostExecute</code>.My problem is that <code>this</code> means the context of the application. When I move it in <code>onPostExecute</code> it doesn't get that context anymore. I tried to replace it with <code>getApplicationContext()</code> , <code>activityName.this.getApplicationContext</code> but it doesn't work because it's expecting the context of the application. I found this <a href="https://stackoverflow.com/questions/2002288/static-way-to-get-context-on-android">Static way to get &#39;Context&#39; on Android?</a> but I can't define a name in the manifest for some reason. What other method of getting the application's context can I use in the onPostExecute method of the asyncTask? Or should I just make an Asynck task with the context as a parameter ?</p>
  
  <pre><code>CustomListAdapter adapter=new CustomListAdapter(this, email,about);
                  list=(ListView)findViewById(R.id.list);
  
  
   list.setAdapter(adapter);
  
              list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
                  @Override
                  public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                          int position, long id) {
                      // TODO Auto-generated method stub
                      String Slecteditem= email.get(position);
                      Toast.makeText(getApplicationContext(), Slecteditem, Toast.LENGTH_SHORT).show();
  
                  }
              });
  </code></pre>