Sharing NavigationView with all the Activities?

后端 未结 2 1034
感情败类
感情败类 2021-02-14 17:06

How do we share Drawer with all the activities?

In the lister: onNavigationItemSelected of setNavigationItemSelectedListener we can

相关标签:
2条回答
  • 2021-02-14 17:29

    I found the answer using this SO answer

    Extending is the right way. Just override setContentView in the right way...

    0 讨论(0)
  • 2021-02-14 17:46

    I am a bit confused here as well. After finding very little information on this I tried to extend my subclass

    public class NewActivity extends MainActivity{
         ...
    }
    

    However, this alone didn't do anything. the MainActivity has a fully functioning NavigationView that will navigate to each activity..Only thing that is left is sharing it with each activity.

    0 讨论(0)
提交回复
热议问题