I have a specific scenario and I need your help.

I'm trying to build an App in Android that involves network communication.

I am using AsyncTask for the http POST requests.  

I have another class called Proxy (not a good one.. will be changed) which holds different kinds of functionalities (registerUser, setUserName, getUserPermission...)  

And Of course, I have an Activity.

My Activity holds an instance of Proxy class.
My goal, is to push a button in the activity, it will call a method from Proxy class, which in its turn calls the AsyncTask's execute() method that actually run the http POST.

I was wondering how to get the data from AsyncTask's onPostExecute to my activity.

What I have in mind is to have an interface in AsyncTask, which will be implemented in Proxy class, and another interface in Proxy class which will be implemented in my Activity class.

Roll the data all the way to my Activity.

I want to hear your thoughts about whether this is the way to go, or another approach is preffered.

Thanks a lot for your help.  

Adding some code   

```
public class RegisterActivity extends FragmentActivity implements Proxy.OnProxyHttpPostResponseListener {

private Proxy proxy;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        this.proxy = new Proxy();
        this.proxy.setHttpPostResponseListener(this);
    }

   @Override
   public void onProxyHttpPostResponse(String response) {
       //Do something when http post returns
   }
}

public class Proxy {

    public interface OnProxyHttpPostResponseListener {
        void onProxyHttpPostResponse(String response);
    }
    private OnProxyHttpPostResponseListener httpPostResponseListener;

    public void setHttpPostResponseListener(OnProxyHttpPostResponseListener listener) {
        this.httpPostResponseListener = listener;
    }

    private class HttpPostAsync extends AsyncTask<Pair<String, ArrayList<Pair<String, String>>>, Void, String> {

        @Override
        protected String doInBackground(Pair<String, ArrayList<Pair<String, String>>>... params) {
            return this.httpPost(params[0].first, params[0].second);
        }

        protected void onPostExecute(String response) {
            httpPostResponseListener.onProxyHttpPostResponse(response);
        }
    }

```