Knowledge Tree-talk Android (20,190,819)

1. Androd request in the network, if the network after completion callback request, activity has been recovered, and how to deal with?

Examine knowledge:

  • acitvity view relationships and life cycle & Memory Model
  • How to prevent memory leaks (weak references, cancel and request a callback)

 Solving knowledge:

   The default view held by activity (content) references, activity can be finish, but not destroyed;

         mvp p can be held view by weak reference solve network problems return;

  • kotlin cancel the callback process implemented by the Association (binding activity life cycle )

        In experiment...

Guess you like

Origin www.cnblogs.com/qishuai/p/11371629.html