Open iforvard opened 7 months ago
Flut support for Android is not very good, mainly on Windows. My app import some packages, eg. tinytag, which Android could not recognize and show tinytag was not available
I'm having the same problem. Is there a way to assign commands to the phone's navigation key?
Estou tendo o mesmo problema. Existe uma maneira de atribuir comandos à tecla de navegação do telefone?
I also want this, instead of closing the application it returns to the page.
Same issue with S23
I solved this problem with the route change function using views.I used system exit() with import sys for the back key
I'm having the same problem on HUAWEI HarmonyOS.
add this in your code:
`def event(e): if e.data=='detach' and page.platform == ft.PagePlatform.ANDROID: os._exit(1)
page.on_app_lifecycle_state_change = event`
Could it be possible to minimize the app as if middle button was pressed instead of exit, so it will open faster the next time?
Could it be possible to minimize the app as if middle button was pressed instead of exit, so it will open faster the next time?
Ad this to your code `def event(e): if e.data=='detach' and page.platform == ft.PagePlatform.ANDROID: os._exit(1)
page.on_app_lifecycle_state_change = event`
When you press middle button it will minimize and when you press back button app will close. You need flet 0.4.0 at least
I think minimizing would be better but maybe not possible? I've tried before exit on page.on_view_pop and page.on_window_event == minimize, but it didn't work, your solution works perfectly, thank you! It still crashes when opening very fast after closing but hopefully no user will be doing that too much.
I solved this problem with the route change function using views.I used system exit() with import sys for the back key
hi, plz help me for closing flet-app when i swipe-back on my android device, i want to render prev view when swipe
add this in your code:
`def event(e): if e.data=='detach' and page.platform == ft.PagePlatform.ANDROID: os._exit(1)
page.on_app_lifecycle_state_change = event`
Thank you so much
Could it be possible to minimize the app as if middle button was pressed instead of exit, so it will open faster the next time?
Ad this to your code `def event(e): if e.data=='detach' and page.platform == ft.PagePlatform.ANDROID: os._exit(1)
page.on_app_lifecycle_state_change = event`
When you press middle button it will minimize and when you press back button app will close. You need flet 0.4.0 at least
Thankssssss it's not crashing now!!!! Now thought now I would have to learn Java or Kotlin! But seems like I can continue with Flet! Thanks again man!
Bro it didn't completely solve the problem, it still crashes, however the crash has been minimized. I would say, don't frequently open and close your flet program, let it take some time, especially if it is saving some stuff or vice verse (fetching some data). Thanks!
I also have this problem, and a problem with closing the application, when I try to go back to the previous page with the back button and closing the application, I tried using on_view_pop, but nothing works
My flet 0.24.1 and Android 11 phones have the same problem.
Description
After building an Android APK using Flet, the app crashes when reopened after being closed with the back button. The crash does not occur if the app is closed through the system's "Recent Apps" menu.
Steps to Reproduce:
Reproducible on devices:
Samsung S21 Ultra (Android 14) Sberbox (TV stick with Android 9)
The official flet app on google play has the same behavior (video):
https://github.com/flet-dev/flet/assets/48457650/d1ff4f6a-60fe-4bde-81aa-980ecc8e16e6