如何在每个活动中显示导航抽屉?

时间:2017-04-20 22:14:16

标签: java android

MainActivity

public class MainActivity extends AppCompatActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        initNavigationDrawer();

    }

mobile_form

public class mobile_form extends AppCompatActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        view= findViewById(android.R.id.content);

}

我需要添加第二个活动

1 个答案:

答案 0 :(得分:0)

您只能使用一个活动并且在多个片段内