BaseActivity for Navigation

前端 未结 6 1735
猫巷女王i
猫巷女王i 2020-12-24 09:21

I\'m building a base activity for navigation and want something flexible so the Activity dictates to the Base Activity which layout to inflate.

I have the following<

6条回答
  •  甜味超标
    2020-12-24 10:01

    you could either override setContentView in your BaseActivity and initialised everything after the super call or move all the DrawerLayout related stuff to a protected method and call it from each children of BaseActivity, after you call setContentView. I think the first should be straightforward an, from what you posted, you can avoid to override onCreate in the BaseActivity

提交回复
热议问题