[android] How to get the result of OnPostExecute() to main activity because AsyncTask is a separate class?

Create a static member in your Activity class. Then assign the value during the onPostExecute

For example, if the result of your AsyncTask is a String, create a public static string in your Activity

public static String dataFromAsyncTask;

Then, in the onPostExecute of the AsyncTask, simply make a static call to your main class and set the value.

MainActivity.dataFromAsyncTask = "result blah";