We'll be using Fragments with our Activity, in this app.

Don't worry about what that means, just yet. I'll be explaining all about Fragments in the videos.


In Android Studio 3.5, Google have removed the Use a Fragment checkbox, when you create a new project.

That's not a huge problem, as they're very easy to create. Remember that the New Project templates just save you a bit of work, they don't do anything that you can't do manually.

Because the Use a Fragment checkbox has been removed, the Basic Activity template no longer creates a Fragment for you. So we'll have to do it manually.


Once you've created your project, and Android Studio has finished syncing and building the project, right-click on your package name in app/java.

From the context menu, choose New > Fragment and select Fragment (Blank) from the list.



The Fragment Name should be MainActivityFragment.

Make sure the box to Create layout XML is ticked.

Change the Fragment Layout Name, to fragment_main.




To get the same code as the videos, untick both the boxes: Include fragment factory methods and Include Interface callbacks.


Finally, choose your language, Kotlin or Java, and click Finish.


You'll then have the same files as you would have had, if you'd ticked the Use a Fragment checkbox.