1
For older versions you will need to use the method getSupportActionBar()
.
See that for this your class will have to inherit from ActionBarActivity
or AppCompatActivity
or instead of Activity
:
public class MinhaAtividade extends ActionBarActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setTitle("Meu titulo");
setContentView(R.layout.activity_minha_tela);
}
// ... demais métodos
}
Denis, to facilitate the life of those who are responding, and indexing / search for answers, avoid pasting print screens code. It is always best to paste the code itself into the body of the question.
– Anthony Accioly