Get file name and extension of any file in android
问题 The issue I have, is that i can't extract the file exetension from files choosen on a smartphone with Android 9. The problem doesn't appear on devices with Android 8 or less. When the user has choosen any kind of file the onActivityResult gets called. In this method I call getPath from FileUtils class, so I can extract the file extension. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Uri uri = new Uri.Builder().build(); if (resultCode == RESULT_OK)