如果我在活动中具有无限动画并离开活动,是否会导致内存泄漏?我必须明确停止动画还是以某种方式在框架级别进行管理?我所说的无限动画是什么:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:repeatCount="infinite">
<rotate
android:duration="1000"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="restart"
android:toDegrees="360" />
从开发人员网页:
通常,您应该使用onPause()回调执行以下操作:停止可能消耗CPU的动画或其他正在进行的操作。
来源:http : //developer.android.com/training/basics/activity-lifecycle/pausing.html#Pause
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句