I have a navigation drawer and I want to open a new Activtiy.The navigation drawer and the MainAcitvity runs really smooth but when I want to start a new activtiy ist takes a lot of time and lagging
here is my code:
public void onNavigationDrawerItemSelected(int position) {
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.container, FirstFragment.newInstance(position + 1))
.commit();
if(position==5)
{ Intent i=new Intent(MainActivity.this,SettingsActivity.class);
startActivity(i);
mTitle = getString(R.string.title_section1);
}
}
I have no idea how solve this but is really annoying