How to prevent Android to restart application after calling camera intent?

家住魔仙堡 提交于 2019-12-05 20:43:03
timoschloesser

I faced the same issue a while ago: Android system stops application when launching Media Intent

Apparently there is no solution, so you have to make sure that you save and restore the application state.

Well i think, the problem could be: Image byte array is too big such that it touches the limit and android restarts the application so following is what will i do:

  • Calling the intent with some parameter telling to downsample the bytes it gonna send back.

OR

  • Implement your camera using surfaceview and then when user takes some picture, save it temporarily on sdcard and return only the path... then get the path in onActivityResult and use the picture.

Hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!