-
Notifications
You must be signed in to change notification settings - Fork 58
Description
In my kotlin project, libgdx is used for client graphical interface, where the main game logic is launched and ran by kotlin coroutine. This is pretty straightforward for desktop, but not so much for Android. I spent some time to realize that I can use lifecycleScope for Android (https://developer.android.com/topic/libraries/architecture/coroutines#lifecyclescope).
However, the android template generated by this wizard and some other open source projects that I referred to rely on the default AndroidApplication
class, and I spend a pretty long time to realize that this doesn't work nicely with lifecycleScope. Where a simple AndroidFragmentApplication
with FragmentActivity
(https://github.com/libgdx/libgdx/wiki/Starter-classes-and-configuration#game-fragment) works flawlessly in my case.
Therefore, I suggest that including a template of FragmentActivity
may help other people to set things up quicker.