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
Post a Comment