wrong requestcode when using startActivityForResult

You are calling startActivityForResult() from your Fragment. When you do this, the requestCode is changed by the Activity that owns the Fragment.this

If you want to get the correct resultCode in your activity try this:code

Change:get

startActivityForResult(intent, 1);

To:it

getActivity().startActivityForResult(intent, 1);
相關文章
相關標籤/搜索