N
N
nikita0710032020-04-30 01:08:45
android studio
nikita071003, 2020-04-30 01:08:45

Why does it find the xml file by R.layout.activity_nameActivity?

I create the second activity (Empty Activity) - everything is ok. (First - main activity)
I create the third (Empty Activity) - the file with the Java code cannot find xml, although it exists . It

gives an error at this moment:

setContentView(R.layout.activity_message);

The light bulb suggests solutions: create a new xml. I press "Create". Error - it already exists

5ea9fac1cb143741881476.png

How to fix?

UPD: Created another (already 4th) activity. Works. What the hell?
UPD2: After the creation of the 4th one, the 3rd one also began to work ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Pokrovsky, 2020-04-30
@nikita071003

If you just created an activity, just run the app, android studio is stupid

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question