How to change the text on the action bar

前端 未结 18 785
春和景丽
春和景丽 2020-11-22 12:30

Currently it just displays the name of the application and I want it to display something custom and be different for each screen in my app.

For example: my home scr

18条回答
  •  粉色の甜心
    2020-11-22 13:29

    Inside Activity.onCreate() callback or in the another place where you need to change title:

    getSupportActionBar().setTitle("Whatever title");
    

提交回复
热议问题