0

all.

I'm trying to go through the book Android How to Program (2nd edition). So far, I've been doing alright. But in the last day or two, when I try to create a new Android Application, I have to enter a name for a fragment if I want to create an activity (ie Fragment_main).

I do not want to work with fragments right now. I do want to learn how to use them eventually, but at this point in my reading they are only getting in the way since the book doesn't use them for this project.

I can name the fragment the same as my layout name so a separate fragment xml file isn't created, but is there a way to not use fragments at all at this point or is Google trying to force us to use them?

Any help or advice would be appreciated.

Thank you all.

mswengel
  • 1
  • 3
  • You aren't forced to work with Fragments, if you aren't ready to. You can still work with activities. Older apps are still working on new devices. – Phantômaxx Mar 14 '14 at 18:08

2 Answers2

0

A fragment is XML code for a portion of an activity. In otherwords, there's nothing in your src folder because it isn't an activity. You've created a "fragment" (A layout for an activity)

In eclipse, Hit File > New > Other. In the Android Folder, select "Android Activity" from the options.

Best of luck!

JRad the Bad
  • 511
  • 5
  • 25
0

I just started learning android development last week and I am having the same issue as you. I found out that since I updated the ADT to 22.6.0 (See changes here), google changed the way project templates are created.

Solutions:

  1. Download a version of the ADT prior to 22.6.0 and don't update it.
  2. Keep your current version of the ADT and follow the instructions in this answer on how to removed the fragments from your project.
Community
  • 1
  • 1
Roger Williams
  • 159
  • 2
  • 7
  • 15