Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是一个侦听器,例如 EditText 上的 TextWatcher,当视图滚出屏幕时被销毁或移除。例如,我有一个 ListView,其中每个 ListView 项中有几个 EditText。当项目滚动回到屏幕上时,是否需要向 EditText 添加一个新的侦听器?
侦听器附加到,EditText因此如果EditText未销毁,则侦听器附加到它。
EditText
当我们滚动列表时,ListView 会破坏不可见的项目视图,因此 EditText 等视图也会自动释放。
所以需要重新设置监听器。