I used cameraex codes. Link is given below. In these codes camera is opened at the first layout (panel) and camera is initialized at the Activite_Resume.
https://www.b4x.com/android/forum/t...tends-the-camera-library-functionality.23801/
But in my app, there is a general view when app starts. There is a button at the main view for camera. When the camera button is pressed PanelCamera is opened and camera is initialized.
The difference; "InitializeCamera" is written in another place.
"camEx.Release" is written at the Activity_Pause sub like in original codes.
Camera works. No problem. But when the camera is opened and I close the app, failure occurs sometimes. Sometimes failure doesn't happen but when I opened app again, white screen comes in front of me so, I need to go to the main view and come back to the camera.
This problem happens I think as DonManfred said, "camEx.Release" is written still at the Activity_Pause sub although camerapanel is not initialized at the Activity_Create.
If I write "CamExRelease" to the sub which is used to back to the main menu, camera fails. There occurs misunderstanding view at the camera screen.
What should I do?
https://www.b4x.com/android/forum/t...tends-the-camera-library-functionality.23801/
But in my app, there is a general view when app starts. There is a button at the main view for camera. When the camera button is pressed PanelCamera is opened and camera is initialized.
The difference; "InitializeCamera" is written in another place.
"camEx.Release" is written at the Activity_Pause sub like in original codes.
Camera works. No problem. But when the camera is opened and I close the app, failure occurs sometimes. Sometimes failure doesn't happen but when I opened app again, white screen comes in front of me so, I need to go to the main view and come back to the camera.
This problem happens I think as DonManfred said, "camEx.Release" is written still at the Activity_Pause sub although camerapanel is not initialized at the Activity_Create.
If I write "CamExRelease" to the sub which is used to back to the main menu, camera fails. There occurs misunderstanding view at the camera screen.
What should I do?
B4X:
Sub BtnCamera_Click
PanelMain.Visible = False
PanelCamera.Visible = True
InitializeCamera
End Sub
Sub Activity_Pause (UserClosed As Boolean)
camEx.Release
End Sub
Sub BtnCameraBack_Click
PanelCamera.Visible = False
PanelMain.Visible = True
End Sub