Empty intent extras in onActivityResult

前端 未结 2 1867
栀梦
栀梦 2021-01-13 13:24

I have two activities.

First calls second like this:

Intent intent = new Intent(this, Second.class);
startActivityForResult(intent, 1);
相关标签:
2条回答
  • 2021-01-13 13:46

    I also ran into this and found the answer in the comments. To make it more discoverable for the next guy, let's restate as answer:

    You must read the same data-type as you put in.

    0 讨论(0)
  • 2021-01-13 13:49

    Just call this lines before calling super.onFinish() or wherever you exit the previous activity

    Intent intent = getIntent();
    intent.putExtra("Date",dateSelected);
    setResult(RESULT_OK, intent);
    
    0 讨论(0)
提交回复
热议问题