Reputation: 47
I'm using an activity context from a non-activity class.
I don't want any transition between Activities, but sometimes there is no transition and sometimes there is.
Here is my code:
Intent myIntent = new Intent(this.context, Lose.class);
context.startActivity(myIntent);
((Activity)context).overridePendingTransition(0, 0);
Does anyone understands what part of my code causes this inconsistent behaviour?
Upvotes: 0
Views: 204
Reputation: 7674
Try adding this to your Intent:
myIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
Upvotes: 1