Reputation: 10589
If im on a Smartphone and when i rotate the screen to landscape i need to start an Activity
. For now i do this in the onResume()
of my Fragment
:
@Override
public void onResume() {
super.onResume();
if (!HelperDevice.isTablet(this.getContext())) {
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
this.getActivity().startActivityForResult(new Intent(this.getActivity(), ActivityImageInspirations.class), Globals.REQUEST_IMAGE_INSPIRATIONS);
}
}
}
This is working perfectly on Nexus 4
but on Nexus 5
for example the screen is flickering like 10 or more times until it starts the activity successfully. it seems like the activity is started and finished instantly what causes the flickering.
What could cause such an behaviour?
Upvotes: 0
Views: 304
Reputation: 24211
You should Override
the function onOrientationChange
instead of onResume
Upvotes: 1