user3424411
user3424411

Reputation: 13

activity_main.xml not in layout folder as well as anything else

I am doing the tutorial for making your first android app and it is saying I need to open the activity_main.xml file in the layout folder.

However, when I open the the layout folder it doesn't have anything in it. There are no files at all.

This is the first bit of programming I am doing. please give me an answer.

Upvotes: 1

Views: 10121

Answers (5)

Tshepiso Makuoa
Tshepiso Makuoa

Reputation: 1

1.I have been trying to get the activity_main.xml too but i couldn't find it, i had to create one using the following steps:

  1. Go to New, Activity and select the layout you want ([you then select the type of view you want.]) After creating the layout view (the activity_main.xml), the MainActivity class will be created automatically.
  2. You can start a new project and choose Empty Views instead of choosing new project. 1

Upvotes: 0

Knuros
Knuros

Reputation: 1

Make sure that the the Activity Name and Layout name are not completely different

Upvotes: 0

mike20132013
mike20132013

Reputation: 5425

It is possible that you didn't create the activity when you created the project and that's the reason you don't see the layout in your When you created the project:

Please follow these steps:

1) Enter your application name in the wizard.

2) Enter Project Name

3) Enter package name.

4) Check mark on 3 items when you clck next "Create custom launcher icon", "Create activity", "Create project in workspace"

5) Again when you click next, Check mark on Create Activity and do next.

6) Make sure that the next screen has all the fields populated. Like (Activity name, Layout name)

7) After all that, click finish.

You must have missed all these steps while creating your project. Try this.

Upvotes: 0

scottt
scottt

Reputation: 8371

If your files are in the disk folder, but aren't showing in Eclipse, then you'll want to refresh the project contents. You can do that by clicking on your project in either the Project or Package window and pressing F5 (or by right-clicking and selecting the Refresh item.)

Upvotes: 0

Eamon Scullion
Eamon Scullion

Reputation: 1384

Your layout xml files are located in src/main/res/layout/. If they do not show up, you can check the file directory where the project is saved on your computer. If they still do not show up I suggest restarting eclipse and then rebuild/clean. If the problem persists you may need to create a new project

Upvotes: 2

Related Questions