How to add libgdx as a sub view in android

前端 未结 4 1337
别那么骄傲
别那么骄傲 2020-12-24 02:28

I have main.xml as follows:

  
     ...
     

        
4条回答
  •  囚心锁ツ
    2020-12-24 03:33

    The AndroidApplication class (which extends activity) has a method named initializeForView(ApplicationListener, AndroidApplicationConfiguration) that will return a View you can add to your layout.

    So your Test-class can extend AndroidApplication instead of Activity so that you can call that method and add the View to your layout.

    If that's not an option, for some reason, take a look at what AndroidApplication source code does, and mimic that.

提交回复
热议问题