FragmentA respond to onConfigurationChanged correctly but if i open FragmentB on top of it and rotate the device it's onConfigurationChanged triggered and also triggered onConfigurationChanged of FragmentA.
I have fragmentA in activity and FragmentA respond to onConfigurationChanged with in it and open another activity on landscape mode and if click on FragmentA list its open detail fragment lets call it fragmentB. fragmentB also have method onConfigurationChanged and open another activity in landscape mode.
FragmentA{
@Override
public void onClick(View v) {
//open FragmentB
}
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
} else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
//landScape of FragmentA
//open any Activaty
}
}
FragmentB{
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
} else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
//landScape of FragmentB
//open any Activaty
}
}
orientation change on fragmentB cause open two activity's .One from onConfigurationChanged of fragmentA and one from onConfigurationChanged of FragmentB.