antoniolg / androidmvp

MVP Android Example
5.94k stars 1.58k forks source link

How about life cycles ? #7

Closed stephanenicolas closed 8 years ago

stephanenicolas commented 9 years ago

The presenter is recreated each time a new instance is created, as during a rotation. This doesn't address one of the main Android issues.

Let's say you got a network request, initiated by the presenter of the activity before rotation, how can the new instance take advantage of the request pending or resolved ?

antoniolg commented 9 years ago

You could improve the example to do it like that, saving somewhere (maybe an static component) that the request has already been done, and requesting it when the presenter is recreated. When you start listening the bus, then you can decide if you execute the request or wait for the response of an old request.