How to open a file in another app with FileProvider for Android 7+

Android 7 Nougat and higher have new security restrictions which makes Uri.parse() unusable to get access to files in internal or external storage. Instead, we need to use the FileProvider class which is available in the Android Support Library. In this tutorial, I show you how to use FileProvider to access files in internal and external storage.