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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -