I'm currently trying to implement fragment transaction animation like this (Fragment related classes are imported from support library):
FragmentTransaction trans = getFragmentManager().beginTransaction();
trans.setCustomAnimations(R.anim.slide_in,R.anim.slide_out);
trans.replace(R.id.preview_panel, fragment);
trans.commit();
The animations are defined like this:
slide_in.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="-100%p"
android:toXDelta="0"
android:interpolator="@android:anim/linear_interpolator"
android:duration="500"/>
</set>
slide_out.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="-100%p"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="500"/>
</set>
Now whenever I run the transaction piece of code once it works fine. However when I run it a second time the app crashes with the following error:
Fatal signal 11 (SIGSEGV) at 0xff000008 (code=1), thread 11015
Whenever I remove the setCustomAnimations line this piece of code works fine every time it is run. What could be the issue here and how would I able able to solve/workaround it?
EDIT: Managed to narrow down the issue a little bit:
It happens when the fragment being replaced transaction contains a webview with the VideoEnabledWebChromeClient shown in this StackOverflow answer attached.
The error also only occurs on the fade out animation (that's why it seemed like it was only occuring the second time). When I change the animation to trans.setCustomAnimations(R.anim.eqdpost_slide_in,0);
a it works fine.