-3

I'm using ObjectInputStream/ObjectOutputStream to send an object. I'm trying to send an SQLiteDatabase but I'm getting an error when doing so.

java.io.WriteAbortedException: Read an exception; 
java.io.NotSerializableException: android.database.sqlite.SQLiteDatabase

I've tried searching but haven't really been able to find a solution. Thanks

dwefd
  • 1
  • 1

1 Answers1

2

You cannot serialize arbitrary objects. Among those that you cannot serialize is a SQLiteDatabase. This is why you are getting a NotSerializableException — that object is Not Serializable.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491