I've started programming an app for android importing the Navigation Drawer code sample from android studio. Running it I got the error
Error:(43) No resource identifier found for attribute 'layoutManager' in package 'com.example.android.navigationdrawer'
I've followed the instructions found in Error 'No resource identifier found' with Android sample project but I got the following error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.navigationdrawer/com.example.android.navigationdrawer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference
I couldn't find another answer that I can adapt since my skills are quite basic.
The only differences from the original NavigationDrawer sample code are:
I removed from activity_navigation_drawer.xml:
app:layoutManager="LinearLayoutManager"
I added the last two lines in this NavigationDrawerActivity snippet
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_navigation_drawer);
mTitle = mDrawerTitle = getTitle();
mPlanetTitles = getResources().getStringArray(R.array.planets_array);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (RecyclerView) findViewById(R.id.left_drawer);
LinearLayoutManager mLinearLayoutmanager = new LinearLayoutManager(this);
mDrawerList.setLayoutManager(mLinearLayoutmanager);
....
Thanks in advance for the help