BUG: Sometimes upload works, sometimes doesn't. Solution: If you want to get the result in your activity try to change:  startActivityForResult(intent, 1); to getActivity().startActivityForResult(intent, 1)