PutExtra doesn't work on the retriever side

前端 未结 4 1154
借酒劲吻你
借酒劲吻你 2021-01-07 06:18

I want to sent intent from one first activity to another.

The first activity sends an intent to the second activity in order to create a new AlertDialog, receive a n

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-07 06:28

    in onActivityResult you are not suppposed to call

    intent = getIntent();
    

    directly you have got the

    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    

    where data corresponds to the data sent from the alert box activity. Just directly calling

    data.getIntExtra("data2", -1);
    

    should do. Hope I was clear enough.

提交回复
热议问题