from the adapter of a RecyclerView which is contained in an Activity, i\'m trying to launch a fragment when an element of the RecyclerView is pressed, this is my code right
You cannot start a Fragment with Intents so the method that I recommend to you is :
Fragment mFragment = null;
mFragment = new MainFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
For more information see Fragments Transactions documents