- this is right. I have this gridview . I want to save its element as blob in sqlite. so when i open the list of save data in sqlite just load save items and call adapter.notifyDataSetChanged on my gridview
I tried this, but getting a NotSerializableException error
List items = new ArrayList ();
public static byte[] serializeObject(Object o) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { ObjectOutput out = new ObjectOutputStream(bos); out.writeObject(o); out.close();
my insert line
public long insertRow(byte[] data) {
then i insert the serialize object
myDB.insertRow(MyDBAdapter.serializeObject(items));
I am also confused. Should I save an adapter or list of items?
android sqlite gridview
user3487657
source share