onCreate() and onCreateView() invokes a lot more than required (Fragments)

前端 未结 6 2033
不知归路
不知归路 2021-01-30 10:19

Can somebody explain why the onCreate() and onCreateView() are being invoked so many times which increments with each orientation change?

Here

6条回答
  •  时光取名叫无心
    2021-01-30 11:05

    Looks like you have so many fragments there! If you define fragment in xml file you can not define "it" again in your code! There are two ways how to define fragmets: dynamiclly (in your code) and statically (in your xml)! Take a look here: http://marakana.com/s/post/1250/android_fragments_tutorial

    It is really good tutorial.

提交回复
热议问题