Hello World differs from the Android Studio version

0

I was watching a video lesson of a guy who was using Android Studio version 1.3. As much is generated, he was just removing what was not necessary. I was doing this process, but I realized that the result in 1.5.1, which is the version of the ide that I use is different.

What happens is that his example did not have the last two lines of code:

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

The example of it, using version 1.3 without the above two lines worked as it is in the emulator, but in 1.5.1 without these lines the project name, which is Agenda is no longer displayed.

Could anyone explain why we have this difference?

    
asked by anonymous 28.03.2016 / 01:12

1 answer

1

In newer versions of Android Studio, you no longer need to set the ActionBar programmatically when the class inherits from AppCompatActivity. It is already defined by default in the theme.

    
19.05.2016 / 15:50