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.
mushahid
source share