Android: AsyncTask recommendations: private class or public class?

后端 未结 2 2010
深忆病人
深忆病人 2020-12-04 14:25

I\'m currently developing some Android Apps in a team and we\'ve used 2 different approaches during the last months (one that i personally prefere, and the other that the ot

2条回答
  •  无人及你
    2020-12-04 15:06

    It doesn't matter, use what makes the most sense for your code. The important thing is to watch for an async task that is holding a reference on an activity after the activity has been destroyed, either implicitly as an inner class of the activity, or explicitly by being given the activity/context object.

提交回复
热议问题