android crash /system/lib/libhwui.so

后端 未结 2 1397
走了就别回头了
走了就别回头了 2020-12-16 17:37

there is a crash i have got sometimes , it seems a jni crash , but my application have not any jni code . it\'s is a graphic application , and will load some pictures .

2条回答
  •  清酒与你
    2020-12-16 18:22

    I remember seeing a crash like this and reading about a bug with 4.0.x in particular where removing a hardware layer in an AnimationListener (onAnimationEnd()) would cause this sort of crash. The solution was to post the layer transition as a Runnable. For example:

    @Override
    public void onAnimationEnd (Animation animation) {
        //This will cause a crash
        setLayerType(LAYER_TYPE_NONE, null);
    }
    
    @Override
    public void onAnimationEnd (Animation animation) {
        //This will work successfully
        post(new Runnable() {
            @Override
            public void run () {
                setLayerType(LAYER_TYPE_NONE, null);
            }
        }
    }
    

提交回复
热议问题