В общем решил я эту проблему следующим образом
@Override
public void onAttach(final Context context) {
super.onAttach ( context );
new MainFragment.mDgu (context).execute();
}
class mDgu extends AsyncTask<String, String, String> {
ArrayList<Map<String, Object>> mData;
private Context mActivity;
public mDgu(Context context){
mActivity = context;
}
@Override
protected String doInBackground(String... arg) {
...
}
} catch (IOException e) {
e.printStackTrace ();
}
return null;
}
@Override
protected void onPostExecute(String result) {
mmSimpleAdapter = new SimpleAdapter ( mActivity, mData, R.layout.item_news, from, to );
mSimpleDgu.setAdapter ( mmSimpleAdapter );
}
}