У меня есть приложение с ящиком навигации с фрагментом, созданным из android studio.
Я хочу, чтобы когда я нажимал кнопку, он открывает новое представление (фрагмент или действие) со стрелкой назад на верхний левый, пока панель навигации все еще работает.
как на скриншоте ниже:


I tried with a new blank activity, but there is no back arrow and navigation drawer is not working or gone.
HomeFragment.java
public class HomeFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
HomeViewModel homeViewModel = ViewModelProviders.of(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false);
final TextView textView = root.findViewById(R.id.text_home);
homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
Button button = root.findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getContext(), SlideshowActivity.class));
}
});
return root;
}
}
введите описание изображения здесь
Как создать два скриншота выше?