2

There are multiple questions about this issue (see here, for example) and the solution seems to be to create a getRealPathFromURI method which uses a pretty hacky method to figure out the path of the file. My question is why is this necessary in the first place? Why doesn't getPath return the actual path of the file?

My use case is that I'm receiving an ACTION_SEND intent with MIME type */* and want to copy the file to another location, so I need the full path.

Community
  • 1
  • 1
anderspitman
  • 9,230
  • 10
  • 40
  • 61

1 Answers1

4

You do not understand what a Uri is. Read this to know what it is all about (they don't necessarily point to files on the device all the time), also you have to understand what ContentProviders are. And then use the solution in the question you've linked already to get the actual image file path from the device.

Community
  • 1
  • 1
JanithaR
  • 1,094
  • 2
  • 11
  • 23