Recent

Author Topic: is everything ok with launchmode "standard" (default) in LAMW  (Read 422 times)

maxerist

  • New Member
  • *
  • Posts: 28
Hi,

it took some time for me to see that with the default value of <activity ... android:launchMode="standard"> in AndroidManifest.xml there are some problems with forms.

As I understand there's no pure Activity equivalent in LAMW, what is called activity(=jform) is actually a Layout group shown in the same View. There's only one activity in LAMW (java class ... public class App extends Activity... ). So all those task/activity related issues that java developers are discussing are irrelevant here. I really dont' care, but with launchMode "standard" I could not manage to correctly keep the app running when I left the app with Home button and started it again. As I suppose, Android tried to launch a new instance of the activity (class App). In my instance, Reinit (triggered by LAMW logic) for non-main forms just failed with SIGINT error in jForm_Create call. It looks like the process is the same (debugger keeps working), which means that jni native calls from Android become from different android activity instances that probably means that there were mixed unexpected contexts for Android.

What solved my problems is changing android:launchMode to "singleTask". This allowed to see the app after the launch as if I returned to it from the task/activities shade.

Maybe I'm wrong so the question did anyone manage to make apps with several forms work correctly when launched again (with launchmode "standard")?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2304
Re: is everything ok with launchmode "standard" (default) in LAMW
« Reply #1 on: May 16, 2024, 03:38:21 am »
Quote
What solved my problems is changing android:launchMode to "singleTask". This allowed to see the app after the launch as if I returned to it from the task/activities shade.

Nice!

I will apply you patch!

Quote
Maybe I'm wrong so the question did anyone manage to make apps with several forms...

Yes, several forms... but just one Activity!  So you patch is OK!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018