How to handle RESTful update of remote server with SyncAdapter

后端 未结 2 1502
花落未央
花落未央 2021-01-31 10:29

I\'ve watched the Google I/O REST talk and read the slides: http://www.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html

I\'m still a bit unclear o

2条回答
  •  难免孤独
    2021-01-31 10:51

    What about the Observer design pattern? Can your activity be an observer of the SyncAdapter or database? That way when an update fails, the adapter will notify its observers and can then act on the data that changed. There are a bunch of Observable classes in the SDK, see which one works best in your situation. http://developer.android.com/search.html#q=Observer&t=0

提交回复
热议问题