Architecture-samples: how to handler the view reference in the presenter if the Activity destroy

Created on 23 Jul 2016  路  3Comments  路  Source: android/architecture-samples

when the Presenter is fetching data in the background, the Activity destroyed. Does the IView reference hold by the Presenter need to remove?

Most helpful comment

@JoseAlcerreca Do you think it would be good to catch this possible error and add a solution to these blueprints?

All 3 comments

set the presenter reference null in onDestroy() method, and safely use View reference in Presenter in case of null object exception

@JoseAlcerreca Do you think it would be good to catch this possible error and add a solution to these blueprints?

@mawenge, why does setting presenter reference solve this problem?

Was this page helpful?
0 / 5 - 0 ratings