I have downloaded new SDK and when I create an Activity xml file the Eclipse Juno doesn`t generate that Activity in res-> layout . How to fix it?
Asked
Active
Viewed 110 times
1
-
The Activity is generated in `/src` and its layout in `/res/layout` – Phantômaxx Jun 27 '14 at 15:22
-
I know it . but my problem is that Eclipse Juno doesn't generate it automaticly – Vahe Muradyan Jun 27 '14 at 15:28
-
Why do you need it to generate it automatically? Just duplicate one of your layouts/classes, make the changes, and save. It takes two seconds. :-p – Jonny07 Jun 27 '14 at 15:31
-
"I create an Activity xml file" vs. "doesn`t generate that Activity in res-> layout" -- which is it? You are creating the XML, and you need to do that in `res/layout`. What seems to be the problem? – 323go Jun 27 '14 at 15:33
-
http://stackoverflow.com/questions/11260619/eclipse-juno-wont-create-android-activity – Vahe Muradyan Jun 27 '14 at 15:37
-
something like that question – Vahe Muradyan Jun 27 '14 at 15:37
-
Did you **check for updates**, after upgrading your SDK? I had a similar problem (empty project structure), and that solved it. – Phantômaxx Jun 27 '14 at 15:39
-
yes everything is up to date. can it be from that I have put the target sdk version Android L ? Sdk version 20? – Vahe Muradyan Jun 27 '14 at 15:45
-
It's an hazard... please consider that it's in alpha state. Lollypop will be in the wild not before next fall... – Phantômaxx Jun 27 '14 at 15:53
-
I think it's from new update . I looked in stack overflow several minutes ago and many people have the same problem – Vahe Muradyan Jun 27 '14 at 16:07
1 Answers
1
I know Juno works fine as I'm currently using it.
When you first create your project do:
File -> New -> Android Application Project
This should create the proper android file structure for you. Then when you want to create additional layouts, right click the layout folder under res, and do:
New -> Android XML File.
Then simply create your classes and reference the additional layouts. :)

Jonny07
- 625
- 3
- 14
-
I know that way , so eclipse juno doesn't generate Activities automaticly? – Vahe Muradyan Jun 27 '14 at 15:26
-
I'm not sure what you mean by automatically. This is how I've always done it as as all the pre-generated code in the class is useless and I end up deleting it all anyway. – Jonny07 Jun 27 '14 at 15:28
-
When I chose New File -- Android Activity and after pressing Finish nothing happens , so I jave to create xml activity and class separately ? and then refer class to activity? – Vahe Muradyan Jun 27 '14 at 15:31
-
More than likely yes. This is how I've always done it. I would argue that doing it this way is a superior method than what you're suggesting. Having software "generate" files for you vs creating them yourself is never a good habbit to get into. – Jonny07 Jun 27 '14 at 15:35
-