Android Contentprovider - update within an insert method

前端 未结 2 1514
孤街浪徒
孤街浪徒 2021-01-02 04:30

Is it ok to call the SQLiteDatabase update method in the insert() overridden method of a content provider?

2条回答
  •  迷失自我
    2021-01-02 04:45

    It's your choice what you write in your overridden methods. So yes, it is ok.

    I don't know what you're trying to do, but you might want to to take a look on the SQLiteDatabase's replace() method too. Maybe it better suits your needs.

提交回复
热议问题