What is the meaning of requestCode in startActivityForResult

后端 未结 4 1724
不知归路
不知归路 2021-01-30 16:21

I\'m wondering if I am understanding the concepts of requestCode correectly. What is this integer for and does it matter what integer I set it to in:

         


        
4条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 16:44

    Look my example here. The integer you have to set can be any one positive. Only do not make them the same, you don't want to mix them, do you? And don't put them to 0 - it is returning without result, IMHO, I had strange behaviours with 0. As for negatives, don't use them, too, they are reserved for negative results in other callActivities functions.

提交回复
热议问题