When you create your Intent, you can give it an extra that determines the fragment to load.
Intent i = new Intent(this, ActivityClass.class);
i.putExtra("frgToLoad", FRAGMENT_A);
// Now start your activity
startActivity(i);
Now, inside your activity check the extra and load the right Fragment:
OnCreate(){
...
int intentFragment = getIntent().getExtras().getInt("frgToLoad");
switch (intentFragment){
case FRAGMENT_A:
// Load corresponding fragment
break;
case FRAGMENT_B:
// Load corresponding fragment
break;
case FRAGMENT_C:
// Load corresponding fragment
break;
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…