Activity killed / onCreate called after taking picture via intent

前端 未结 4 1422
天涯浪人
天涯浪人 2020-11-30 02:06

I am trying to take a picture using an intent. My problem is that sometimes after taking a picture my activity, which calls startActivityForResult, seems to be destroyed so

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 02:27

    Actually the camera causes the orientation change in your activity that is why your activity is being destroyed and recreated.

    Add this in your manifest file it will prevent the orientation change and your activity will not get destroyed and recreated.

    
    
    

提交回复
热议问题