android - Error: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment] -
i have fragment named fragment_scheduled_newdetail
, following constructor passing fragment when launching, following error:
error:error: avoid non-default constructors in fragments: use default constructor plus fragment#setarguments(bundle) instead [validfragment]
this seems happen in android studio (i porting project eclipse, no issue in eclipse)
when try create app in release
mode
public fragment_scheduled_newdetail(blockinfo blocktodisplayt) { super(); this.blocktodisplay = blocktodisplay; }
if generate apk in debug
mode, works fine. (release
mode fail)
this strong suggestion android studio. reason "constructors not called when fragment re-instantiated". instead setarguments(bundle) will. according google webpage @ fragment. have code bundle passing?
in android framework, override methods oncreate , oncreateview reinstated, not constructors, when user changes orientation.
Comments
Post a Comment