Есть активити в котором один элемент - фрагмент. При нажатии на кнопку фрагмент не заменяется другим фрагментом.
Активити:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<fragment
android:id="@+id/fragment"
tools:layout="@layout/fragment_login"
android:name="com.orekhov.oneclick.login.LoginFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
Код фрагмента для перехода:
Fragment fragment = new MenuFragment();
getFragmentManager().beginTransaction().replace(R.id.fragment, fragment).commit();