I provide NavigationDrawer in my app.
I'am using manual on http://developer.android.com/training/implementing-navigation/nav-drawer.html
/**
* Swaps fragments in the main content view
*/
private void selectItem(int position) {
// Create a new fragment and specify the planet to show based on
// position
Fragment fragment = new PlanetFragment();
Bundle args = new Bundle();
args.putInt(PlanetFragment.ARG_PLANET_NUMBER, position);
fragment.setArguments(args);
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
// Highlight the selected item, update the title, and close the drawer
mDrawerList.setItemChecked(position, true);
setTitle(mPlanetTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
}
Here I must put my screen like Fragment, but now my screen is Activity, and I want to move from my Activity to Fragment with minimal code change. What can I do this?