Mainactivity does not find activity_main

Asked

Viewed 116 times

3

I try to call the components of my activity_main and he does not think, what can be wrong?

inserir a descrição da imagem aqui

1 answer

4


Check your import’s which R he’s bringing!

This one being shown, belongs to the Android!

To gain access to your project’s layout, import the R concerning your project,

import seu.pacote.R;
  • Yes, actually it had to find automatically, however I had to import the R manually, I made import android. R;

  • It actually brings the list of possible classes starting with R. it is possible to configure. I did a test here: If you type R + Ctrl + space, it brings the one from my package first from the list. Now type R.layo + Ctrl + space, it brings the support: android.support.design

  • Really, I was importing the wrong package, it worked here, thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.