Reputation: 850
I have converted Uri into a string by using toString() method and stored in a shared preferences.
String path = uri.toString();
I would like to convert back to Uri so that I can set the image. I have tried
Uri.parse(path);
or
Uri.fromFile(new File(path));
However, none of them works. How can I set the string back to the Uri?
Upvotes: 0
Views: 464
Reputation: 601
You can use the parse static method from Uri
Uri myUri = Uri.parse("http://stackoverflow.com")
Upvotes: 1