Search code examples
android-studioandroid-fragmentactivity

Android Studio - How To Add A Fragment? (January 2019 Update)


The new Android Studio update came out sometime last week (January 2019 Version 3.3). In the previous version you'd be able to create new project and click a checkbox that said "add a fragment". Unfortunately, in the new update I can't find this checkbox or anything related.

Do we now have to add fragments by hand? Or is there a way to create a project with a fragment?


Solution

  • I found the solution. Before Version 3.3 you were able to create a new project and set the basic activity as a fragment. Since Version 3.3 update it no longer gives you the option to create a fragment when creating a new project.

    So this is how you're supposed to do it:

    Create a new project with whatever activities you want.

    Switch to Android View -> Right click on "app" under the navigator -> New -> Activity -> Basic Activity Now a separate window will open up and you're able to select the checkbox "Use a fragment".