After this call the document is considered closed and none of its methods should be called. Java is a registered trademark of Oracle and/or its affiliates. >> Check For Java VIDEO: Step 1:  Create a new Project  or  open new project Step 2: Code AndroidManifest.xml , , "@style/Base.Widget.AppCompat.Button.Colored", com.blogspot.atifsoftwares.writepdf_kotlin, //we need to handle runtime permission for devices with marshmallow and above, //system OS >= Marshmallow(6.0), check permission is enabled or not, //permission already granted, call savePdf() method, //system OS < marshmallow, call savePdf() method, //show file saved message with file name and path, "$mFileName.pdf\nis saved to\n$mFilePath", //if anything goes wrong causing exception, get and show exception message, //permission from popup was granted, call savePdf() method, //permission from popup was denied, show error message, Add a Back Button to Action Bar Android Studio (Kotlin), Pick an Image from the Gallery – Android Studio - Kotlin. Without diving too deep into the Kotlin language (we will learn everything about it throughout this book) Dev Books. In new activity we will add a back button to actionbar when that button is clicked the main activity will appear...       VIDEO             SOURCE CODE       Step 1:  Create a new Project  or  open new project Step 2: Create New Activity File>New>Activity>EmptyActivity Step 3: Code: activity_main.xml