Hi I am using following code but sometimes app is crashing with error:
java.lang.IllegalArgumentException in startActivity(slideactivity, bndlanim
I found the problem, after digging really deep I saw that there is some problem with the SDK > 21 so lollipop up. In my case this happens when using transparent theme together with some enter and exit transitions.
Two options:
If I remove the ActivityOptions.makeCustomAnimation().toBundle(); and work good again.
If I set my theme to my app normal theme works good too.
I will have to investigate further but I guess there is some configuration on the theme that makes this crash.
Try to use ActivityOptionsCompat
instead of ActivityOptions
if you are using ActivityCompat.startActivity()
.
As well use ActivityOptionsCompat.makeSceneTransitionAnimation()
to make animation options.
instead of
startActivity(slideactivity, bndlanimation);
use
ActivityCompat.startActivity(this, slideactivity, bndlanimation)