Eclipse creates fragment layout automatically, how can i disable it

Burak picture Burak · Mar 10, 2014 · Viewed 15.2k times · Source

I dont want to use fragments and fragment layout. Is this possible to disable eclipse's that property? Firstly, i create a class and xml files then i declare them in Android Manifest file this works for me but it takes a long time if i can disable it, it will be easier.

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

Answer

Rashid picture Rashid · Apr 30, 2014

While creating new Application, just copy the Layout Name to the Fragment Layout Name(eg:activity_main)

Voila! You get an activity without the fragment part.

remove this part of the code from activity

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

Clean the project.