Android setOnCheckedChangeListener calls again when old view comes back

前端 未结 8 1926
鱼传尺愫
鱼传尺愫 2020-12-14 06:39

I cannot solve an issue with the getGroupView-method.

the problem is that the listener setOnCheckedChangeListener is getting invoked to many times.

Let say

8条回答
  •  有刺的猬
    2020-12-14 07:03

    Add the below to ToggleButton layout:

    android:saveEnabled="false"
    

    This would make sure android doesn't store the check state to RestoreInstance and in turn won't cause the state change experienced by you.

提交回复
热议问题