You are right, first of all, you need to start an action, and then set the current fragment to FragmentPager / Manager ... This is not such a way to launch any extraneous fragment from your activity, which can be dangerous, as this will lead to zombie fragments will float around the application (or maybe I donβt know about it ..)
You call Intent Activity with some parameter for the fragment name, you want to run, for example, interger, boolean, etc ...
Intent intent = new Intent(this,SecondActivity.class); intent.putExtra("fragmentNumber",1); //for example startActivity(intent);
You check the passed value inside OnCreate from Second Acitivty and set the desired fragment on top .. inside OnCreate
if(getIntent().getIntExtra("fragmentNumber",0)==1){
However, I have no problem "It was unable to locate the activity." You entered the Activity file in the manifest, what problem did you encounter? Please post the full stack trace.
source share