Android - How can I pass data related to two tables to a the insert method of a Content Provider

后端 未结 3 1578
一整个雨季
一整个雨季 2020-12-10 23:01

I need to insert data related to an Order and its corresponding Detail.

Without a ContentProvider I would do something like t

3条回答
  •  生来不讨喜
    2020-12-10 23:21

    You can design content provider to mirror your SQLite tables, and use insertOrder code same as above.

    Just use insert of content providers for each table(uri), to perform similar operations as in your insertOrder method

    Another option is to define your content provider URI to take combination of your Order and items , and implement the parsing yourself in the content provider before committing to underlying data model.

提交回复
热议问题