setResult does not work when BACK button pressed

前端 未结 10 1918
南方客
南方客 2020-11-27 13:08

I am trying to setResult after the BACK button was pressed. I call in onDestroy

Intent data = new Intent();
setResult(RESULT_OK, data) 

But

10条回答
  •  感情败类
    2020-11-27 13:51

    onDestroy is too late in the chain — instead override onPause and check isFinishing() to check if your activity is at the end of its lifecycle.

提交回复
热议问题