user989557
user989557

Reputation: 929

No main.xml file created by Eclipse/ADT

I have the latest version of Eclipse and the ADT. I created a new Android project and in the create wizard it asked me to create an Activity, I did. When the project loads, however, I don't have a main.xml file in res/layout. All I have is the activity.xml file for the activity I created. I even tried creating a project with no activity and I don't get the main.xml file.

Is this the way it should work now?

Upvotes: 2

Views: 8227

Answers (5)

I'm a newcomer in this business, but here is something I discovered using Android Studio, while I was following this tutorial. On the Android Studio (New Project) Home screen, there are many options available, and among them, there are:

1- "No Activity": Your created project ends up without activity_main.xml, and without MainActivity.java as well

2- "Empty Activity": You end up with empty activity_main.xml and MainActivity.java files in your project directory, which I assume Android Studio creates by default for "Empty Activity" projects.

Screenshot of Android Studio "New Project" Home Screen

Upvotes: 0

AbbyPaden
AbbyPaden

Reputation: 602

I selected API 14 and I get the same result: no main.xml file. Just the activity_main.xml. I am going to assume that this has replaced main.xml?

Upvotes: 1

SOPA
SOPA

Reputation: 21

I think you have need to matching your installer version and ADT version such as installer-20.0.3 and ADT-20.0.3 .

Upvotes: 2

shtef
shtef

Reputation: 11

It appears that the problem is with the default build SDK that is selected in New Project wizard (Android 4.1 API 16). Select API 15 or lower and it will create files just fine.

Upvotes: 1

rajpara
rajpara

Reputation: 5203

Answer is only targeted at ADT R20 not to older ADT version

When ever you try to create your project with NoActivity then there will be no main.xml, DefaultActivity.java created by default & There is no DefaultActivity's entry in AndroidManifest.xml

If you are unable to create new Android project with default activity then here is the solution mention (only for ADT R20) https://stackoverflow.com/a/11260656/582571

Upvotes: 1

Related Questions