Android activity loads wrong layout
I copied a .java
class and .xml
layout. I thought I renamed everything in 开发者_Go百科order to create a new class, but the new class is loading the old layout when I start a new Intent. Am I missing someplace where I need to enter the name of the new layout file I have created from a copy of another class' layout?
I think I missed this line:
setContentView(R.layout.xxx)
This should do it!
If you have not set the launcher activity in manifest then you have to specify which Activity starts first
If you have set old XMl in
setContentView(R.layout.xxx)
then this loads old layout so check for proper xml.
After trying the other answers, try checking the following attribute on your layout element:
tools:context=".SignUpActivity">
That was it for me.
精彩评论