Reputation: 161
I'm using plyer on a Kivy App (Android) and I'm able to use the camera, but after using it the App reset. Did I forget something?
def chamar_camera(nome,pc,objeto,label_passa,instance):
agora = datetime.now()
nome_arquivo = '%s_%s_%.4i_%.2i_%.2i_%.2i_%.2i_%.2i.jpg' % (nome,pc,agora.year,agora.month,agora.day,agora.hour,agora.minute,agora.second)
def sair ():
if os.path.isfile(nome_arquivo) == True: label_passa.text = "Foto de "+pc+"tirada com sucesso"
camera.take_picture(filename=nome_arquivo, on_complete=sair)
When I had error on my code the App just closes, but it is not the case. I also took care for using on_pause and on_resume on my App class. Anybody with the same problem?
Upvotes: 0
Views: 320
Reputation: 29488
Switching to the camera view pauses your app, so Kivy will close unless you have an on_pause
method of your App class that returns True (see this documentation):
def on_pause(self):
return True
If you don't have this method, add it. If you do, it should work so post the full adb logcat log during the problem.
Upvotes: 0