0
I have an Activity and I need to change its title programmatically, I found a way but it doesn’t work for me, check it out:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_relatorio);
Window w = getWindow();
w.setTitle("Relatório de Vendas");
}
I tried to use api 21 and 22 and the title keeps showing the name of the application and the text of setTitle()
is not displayed. How this change can be made?
I do via Manifest, but the funny thing is that in the last app I did, there is Activvity that appears the title and others not, and everything is right in XML.
– André Henrique de Freitas