I have a screen where on a button click I open a file chooser and then I select a file named "Test.jpg" for further operation. I use following code to get name of that file.
Uri uri = data.getData();
File file = new File(uri.getPath());
String fileName = file.getName();
Here are the results from debugger
file.getName() => 167522
file.toString() => /external/images/media/167522
I want to get Test.jpg as my filename. Please let me know what is wrong with my code.