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; } 

enter image description here

if generate apk in debug mode, works fine. (release mode fail) enter image description here

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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -