i am really confused right now because whenever i create a new android app with blank activity it always comes out with fragment_main.xml.. i just wanted to create a blank a
If you download the latest ADT 22.6.3
(with build tools 19.0.3) you will have the option to create a new Empty Activity
that doesn't use fragments
If you don't want the fragment part to be in your app then simply "unckeck the create activity option at project setup wizard, then manually create the activity and layout" for your project.
For those who would like instructions on how to remove Fragments from the project:
1) Copy all the contents of res/layout/fragment_main.xml. Open activity_main.xml, delete the FrameLayout, and paste in the copied contents.
2) Delete fragment_main.xml
3) In MainActivity.java, delete the whole PlaceHolderFragment class:
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main,
container, false);
return rootView;
}
}
4) Delete the following lines from onCreate():
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
At this point you should be all set to run the project.