Вопрос

I have application that opens native camera app and get the captured picture. I have seen that when my application open native camera application it kills all background running applications(including my application).

This issue is also tested in other flow like : I have opened 3-4 other applications. After that I have opened native camera application directly from the home screen. In this case also it kills all the previously opened application.

I would like to have background app remains opens. Can anybody help me here.

I have tested same scenario with Samsung Galaxy ACE and HTC Desire HD. It's working fine.

Device configuration : Motorola Droid 3 , Android version : 2.3.4

Это было полезно?

Решение

Yes got it. I have found the solution for it. My problem was like when I open Motorola Droid 3 camera application , it closes all the background running applications. After searching through blogs and apply some logic and found that it was Native camera issue.

So for the solution, I have saved my application state to bundle using method of

protected void onSaveInstanceState(Bundle outState)

and retrieve saved state from onCreate method again and it works. Now my application does not crash. But one more problem here is like whatever image I have captured from the native camera is not displayed to my screen because it is alreaded restarted so onActivityResult method will not be called.

To solve this issue we have to clear the data of native camera app and have to forced stop it once. After that I open native camera app from my application and it works for 2-3 times and again stops working. Again I clear data and force stop native camera apps and it works.

Other solution to this is I have installed Camera360 application and it works fine for me and no need to use default camera application.

I know this is again a work around but if anybody can give me other better solution then it's fine.

Enjoy.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top