Skip to content

Suggestion: include FragmentActivity example on Android #47

@Adriankhl

Description

@Adriankhl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions