android - @OnClick doesn't works after rotation in ButterKnife -


i have next fragment:

public class myfragment extends fragment {      @nullable     @override     public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {         view view = inflater.inflate(r.layout.my_fragment, container, false);          return view;     }      @override     public void onviewcreated(view view, bundle savedinstancestate) {         butterknife.setdebug(true);         butterknife.bind(this, view);     }      @onclick(r.id.button)     public void onbuttonclicked () {         //do stuff     } } 

onclick method works charm first time , works fine until rotate device. when rotate device, method doesn't works more.

log has no errors.

do know problem?

thanks you.

try retain fragment avoid destroyed , created again.it may resolve problem


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -