Serialize android.net.Uri object

As i think problem is the data member that you saving problem .

private Uri toneToPlay is a non serialize data type and you cannot serialize it.


Consider using java.net.URI class instead. This has almost the same functionality, but it's Serializable. You can easily convert from Uri to URI (and backwards):

Uri to URI: new URI(uri.toString())

URI to Uri: Uri.parse(uri.toString())


URI private Uri toneToPlay is not serializable. So there is an alternative way, you can change the data type URI to String and convert your URI to string and string to URI while use in vise versa.

Uri to String

Uri uri;
String stringUri;
stringUri = uri.toString();

String to Uri

Uri uri;
String stringUri;
uri = Uri.parse(stringUri);