Could not find RippleDrawable

后端 未结 2 920

I want to create a ripple dynamically in code.

Code:

if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      buyButton.setBack         


        
相关标签:
2条回答
  • 2020-11-30 11:55

    The issue is that you need to return a Drawable instead of a RippleDrawable in getPressedColorRippleDrawable. Otherwise, on pre-lollipop devices, you will get a VerifyError.

    0 讨论(0)
  • 2020-11-30 12:00

    That code is indeed not being executed. The app crashes because you're receiving a java.lang.VerifyError. Try performing a Project → Clean if you're using Eclipse or Build → Rebuild project if you're using Android Studio.

    0 讨论(0)
提交回复
热议问题