I have this class for sending email with android
public class SendMailTask extends AsyncTask {
private ProgressDialog statusDialog;
private Activity
From fragment to activity use this :
((YourActivityName)getActivity()).yourPublicMethod();
From activity to fragment use this :
FragmentManager fragmentManager = getSupportFragmentManager();
//include fragment via layout xml
YourFragmentClass fragment = (YourFragmentClass)fragmentManager.findFragmentById(R.id.your_fragment_id);
fragment.yourPublicMethod();