title: Call non static method of the Main class from AsyncTask class
body: <p>I need to call a non static method from AsyncTask</p>
  
  <p>This method must be called in onPostExecute</p>
  
  <p>I have used:</p>
  
  <pre><code>Main.mymethod();
  </code></pre>
  
  <p>But it says:</p>
  
  <pre><code>Cannot make a static reference to the non-static method mymethod() from the type Main
  </code></pre>
  
  <p>How to fix that?</p>
  
  <p>Thanks</p>
  
  <p>EDIT: I have tried with:</p>
  
  <pre><code>    protected void onPostExecute(String result) {
           new Main().mymethod();
      }
  </code></pre>
  
  <p>Throws:</p>
  
  <pre><code>07-09 01:43:15.248: E/AndroidRuntime(29945): FATAL EXCEPTION: main
  07-09 01:43:15.248: E/AndroidRuntime(29945): java.lang.NullPointerException
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.app.Activity.findViewById(Activity.java:1794)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.os.AsyncTask.finish(AsyncTask.java:602)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.os.AsyncTask.access$600(AsyncTask.java:156)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.os.Handler.dispatchMessage(Handler.java:99)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.os.Looper.loop(Looper.java:137)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at android.app.ActivityThread.main(ActivityThread.java:4575)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at java.lang.reflect.Method.invokeNative(Native Method)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at java.lang.reflect.Method.invoke(Method.java:511)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
  07-09 01:43:15.248: E/AndroidRuntime(29945):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>