How do I remove the title bar in android studio?

后端 未结 24 1209
轮回少年
轮回少年 2020-12-04 08:03

In my app there is this title bar at the top where the overflow menu would be, but I don\'t need settings and only have one screen. When I change the theme like described in

24条回答
  •  再見小時候
    2020-12-04 08:54

    try: toolbar.setTitle(" ");

    @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = findViewById(R.id.toolbar);
        toolbar.setTitle("");
        setSupportActionBar(toolbar);
    }
    

提交回复
热议问题