Is there any reason not to call setIntent when overriding onNewIntent?

后端 未结 3 1111
别跟我提以往
别跟我提以往 2020-12-08 07:39

While experiencing a problem similar to this question, I began to wonder why we explicitly have to call setIntent when overriding onNewIntent, and

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 08:09

    The docs for onNewIntent state: "Note that getIntent() still returns the original Intent. You can use setIntent(Intent) to update it to this new Intent." My guess is that onNewIntent exists so that your activity can be notified and the super probably does nothing.

提交回复
热议问题