@Override public void startActivityForResult(final Intent _intent, final int _requestCode) { final FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
final Fragment f = new Fragment() {
@Override
public void onAttach(Context context) {
super.onAttach(context);
startActivityForResult(_intent, _requestCode);
}
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
if (_requestCode == requestCode) {
ThisFramgnet.this.onActivityResult(requestCode, resultCode, data);
}
fragmentManager.beginTransaction().remove(this).commit();
}
};
fragmentManager.beginTransaction().add(f, null).commit();
}