That never go to position == 2 as i see, close if ( position == 1 ) before if ( position == 2 ), try that:
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mDrawerList.setItemChecked(position, true);
mDrawer.closeDrawer(mDrawerList);
if ( position == 1 ) {
Intent intent = new Intent(MainActivity.this, PrimActivitate.class);
MainActivity.this.startActivity(intent);
mDrawer.closeDrawers();
}
if ( position == 2 ) {
Intent intent2 = new Intent(MainActivity.this, Profesori.class);
MainActivity.this.startActivity(intent2);
mDrawer.closeDrawers();
}
}
About the crash you forgot to add to your AndroidManifest.xml
:
<activity android:label="@string/app_name" android:name="com.orar.cngcnasaud.PrimActivitate"/>
<activity android:label="@string/app_name" android:name="com.orar.cngcnasaud.Profesori"/>