Eclipse recently started generating a fragment by default when a new project or activity is created which causes a bunch of issues.
First, generate your projects with minimum SDK 14 to avoid a few issues with the compatibility library:
Next, we want to copy the contents of res/layout/fragment_main.xml
and move them into res/layout/activity_main.xml
and then delete the fragment XML file:
Finally we want to edit the src/com.../MainActivity.java
file to remove the if statement and all inner contents from the onCreate
and remove the definition of the PlaceholderFragment
:
Now we have a project with an activity which we can use that does not require the use of fragments.