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.

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

Change:

startActivityForResult(intent, 1);

To:

getActivity().startActivityForResult(intent, 1);
 
上一篇:在浏览器输入 URL 后会发生什么?超级详细介绍


下一篇:hdu5024 Wang Xifeng's Little Plot (水