android - Put ArrayList in ContentValues -


i'm using couchbaselite in android, want use contentprovider , contentvalues insert documents in db. 1 property of documents arraylist, conentvalues can't put directly arraylist. here code:

contentvalues valuestour = new contentvalues(); valuestour.put(dbfields.column_progress_perc,completionpercentage); valuestour.put(dbfields.column_steps, new arraylist()); //here need put arraylist update(dbfields.content_uri, valuestour, 1234, null); 

is there workaround that?

thanks in advance

you cannot put arrays directly in database. in code, saving address of array useless. easy solution convert array string either using own implementation of tostring() or using third party library (i.e. gson).


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -