PlantFragment.java
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CODE) {
Fragment fragment = new PlantAddFragment();
fragment.setArguments(data.getBundleExtra("bundle"));
getFragmentManager().beginTransaction()
.replace(((ViewGroup) getView().getParent()).getId(), fragment)
.addToBackStack(null)
.commit();
}
}
}
我设法在结果上选择返回的数据但(ViewGroup)getView()。getParent())。getId()在 onActivityResult <中抛出空指针/ p>