How to fix AndroidManifest.xml errors when putting icon in Toolbar

0

because changing the MainActivity.java toolbar to put an icon in the toolbat shows me errors in the AndroidManifest.xml that I did not have before.

MainActivity.java

import android.support.v7.widget.Toolbar;
   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);

       Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
       setSupportActionBar(toolbar);
       getSupportActionBar().setDisplayHomeAsUpEnabled(true);
       getSupportActionBar().setTitle("Titulo Aqui");
       getSupportActionBar().setIcon(R.mipmap.ic_launcher_round);

So you can see the errors in the AndroidManifest.xml, I better put a screenshot.

AndroidManifest.xml

Can you tell me how to remove these errors?

Thank you.

    
asked by SoCu 16.02.2018 в 09:17
source

1 answer

0

I put here in case someone else encounters the same problem.

I tried to find a solution before posting it and I did not find it, anyway, I will put it in case with this second solution it can serve someone, in some cases they said that you have to go to:

  • Go to "File> Project structure> Modules"
  • Click on "add (+)"
  • Click on "Android" and "Apply" and then "OK"

I really did not find the option of Android to be able to apply it. If anyone knows where it is, please tell me ....

In my case it was solved by closing all the tabs or modules that I had open, and when I reopened in AndroidManifest.xml I did not have those errors.

Thanks to those who have bothered to read the post, hehe,

    
answered by 16.02.2018 в 12:03