Eclipse automatically creates a fragment, how to disable it

I do not want to use fragments and fragment layout. Is it possible to disable this eclipse property? Firstly, I create class and xml files, after which I declare them in the Android Manifest file, this works for me, but it will take a lot of time, if I can disable it, it will be easier.

http://i.hizliresim.com/KgMJvQ.png

+8
android eclipse android-fragments android-fragmentactivity fragment
source share
10 answers

Android heard our voice :).

Just upgrade or download ADT Version to 23.0.2 or later.

Now you can select an empty action like this,

enter image description here

0
source share

When creating a new application, just copy the layout name into the fragment layout name (for example: activity_main)

Voila! You get activity without a fragment.

remove this piece of code from the action

if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()) .commit(); 

Clean up the project.

+2
source share

Eclipse provides the ability to create a simple Android application that does not contain Fragment classes or layout files.

You can simply create a simple project, in addition to choosing any templates for the project.

+1
source share

Create a Blank Activity project with a navigation type of none and other default entries.

Copy the contents of fragment_main.xml to activity_main.xml and delete fragment _main.xml

Now go to MainAcitvity.java remove only this part from the MainActivity onCreate() method:

 if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()) .commit(); } 

permanently remove the PlaceholderFragment{} class and its contents from MainActivity.java and then run the application.

+1
source share

There seems to be no tweak to accomplish what you want at the moment (I agree there should be one). As a workaround, this answer to a similar question shows how to remove fragments from a newly created project. stack overflow

0
source share

You can try this. ADT is an empty action created using fragments.

It works great for me when it comes to creating empty actions without fragments.

0
source share

I did this by replacing the BlankActivity folder (22.6.2) with the old sdk BlankActivity (22.6.1) present in the tools / templates directory in android-sdk.

0
source share
  • First you need to downgrade the ADT plugin for eclipse:
    Go to "Help"> "Install New Program" ... and click on the blue link: what is already installed?
    Then select "Tracer for OpenGL ES" and all software products containing "Android", and click "Uninstall." When this is done, download the ADT plugin for eclipse (version 22.3.0) here:
    http://dl.google.com/android/ADT-22.3.0.zip

    Now we are going to install it in eclipse. Go to "Help"> "Install New Program" ... and click "Add" and then "Archive". Browse the archive we just downloaded and click OK. Select all the items in the list and click "Next."


  • At this time, you need to downgrade your sdk tools for Android:
    First delete the sdk tools folder for android.
    Then download the tools (version 22.3) here:
    http://dl-ssl.google.com/android/repository/tools_r22.3-windows.zip

    Then extract it and copy the tool folder to the android sdk folder.


    Do not update eclipse ADT plugins and Android tools (in the sdk manager).
0
source share

You just put the same name as your “Layout Name” in the “Fragment Layout Name” and the wizard will not create the fragment file

-one
source share

When you create a new Android application project using the wizard, after going to the screen that asks you to select the type of activity, select "Empty action" instead of "Empty action" , which by default,

No fragments will be created.

-one
source share

All Articles