0

Is there anyway to make a Activity switch to another activity in a way that it isn't noticeable?

So in this case lets say Activity A and B are basically just empty white screens. I want A to switch to B without the user being able to notice. Is that possible?

arinte
  • 3,660
  • 10
  • 45
  • 65
  • Try custom transition animations, fade out A and fade in B might not be noticeable http://developer.android.com/training/material/animations.html This also might be useful http://stackoverflow.com/questions/6972295/switching-activities-without-animation – JuliusScript Dec 03 '15 at 22:24

1 Answers1

1

Yes. If you want an specific Activity with no animations in or out of it just override onPause and onResume of that Activity like this:

@Override protected void onPause() {
    super.onPause();
    overridePendingTransition(0, 0);
}

@Override protected void onResume() {
    super.onResume();
    overridePendingTransition(0, 0);
}

or you can do this when starting an activity to remove the transition animation:

ActivityA.this.startActivity(intentToActivityB);
ActivityA.this.overridePendingTransition(0, 0);
Moh Mah
  • 2,005
  • 20
  • 29