android - How to use recyclerview in fragment? -


i use navigation drawer in project , want use recyclerview problem when use navigation drawer should use fragments , tried use recyclerview in fragment ,but error displayed in logcat

06-14 21:56:29.376: e/androidruntime(25109): java.lang.runtimeexception: unable start activity componentinfo{com.dmcoder.newsofcoc/com.dmcoder.newsofcoc.activity.activitymain}: java.lang.nullpointerexception: attempt invoke virtual method 'void android.support.v7.widget.recyclerview.sethasfixedsize(boolean)' on null object reference

and i'm sorry , english not good

there no special hackery magic use recyclerview inside fragment.

this error state recyclerview object null. need initialize findviewbyid. if using fragment doing on in override of onviewcreated, supposed inflate layout wish use.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -