开发者

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!


  1. If you have not set the launcher activity in manifest then you have to specify which Activity starts first

  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜