Fix crash when doing adapter operations after rotating screen