Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the app stop, Xcamera is still running in background. #38

Closed
Arjun-nemani opened this issue Jun 29, 2021 · 1 comment
Closed

When the app stop, Xcamera is still running in background. #38

Arjun-nemani opened this issue Jun 29, 2021 · 1 comment

Comments

@Arjun-nemani
Copy link

When I destroy the Xcamera object, the app is crashing. When I close the app on an android 11, the android's camera icon is still active and keeps running until i force "quit the application" .

Once the Xcamera object is created removing it is not stopping , and when i use del it crashes.

Is there a way to exit the camera safely ?

from kivymd.app import MDApp
from kivy.lang import Builder
from kivy_garden.xcamera import XCamera
from plyer import camera
#from android.permissions import request_permissions, Permission
from kivy.uix.image import Image
from kivy.uix.widget import Widget
from kivymd.app import MDApp
```try:
   
   request_permissions([Permission.INTERNET,
                     Permission.READ_EXTERNAL_STORAGE,
                     Permission.WRITE_EXTERNAL_STORAGE,
                     Permission.CAMERA])
except:
      pass```
KV = """
#:import XCamera kivy_garden.xcamera.XCamera
BoxLayout:
    XCamera:
        id : ycamera
"""
       
class uiApp(MDApp):     
        
        
    def build(self):
        print('IM Building here')
        self.screen = Builder.load_string(KV)
        
        self.screen.ids['ycamera'].on_picture_taken = self.on_picture_taken
        return self.screen
    
uiApp().run()
@AndreMiras
Copy link
Collaborator

Yeah dup of #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants