Reputation: 3728
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?
Upvotes: 0
Views: 58
Reputation: 2065
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);
Upvotes: 1