DevLucem/ZoomableVideo

Error Android 7.0

Closed this issue · 2 comments

Hi,
ZoomableTextureView doesnt work sdk>M

Asus Zenphone - Android 7 - All Android studios components up-to-date

Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable

E/art: Failed sending reply to debugger: Broken pipe E/AndroidRuntime: FATAL EXCEPTION: main Process: hbisoft.com.surfaceviewpinchzoom, PID: 30437 java.lang.RuntimeException: Unable to start activity ComponentInfo{hbisoft.com.surfaceviewpinchzoom/hbisoft.com.surfaceviewpinchzoom.MainActivity}: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class com.lucem.lib.ZoomableTextureView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:208) at android.app.ActivityThread.main(ActivityThread.java:6267) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class com.lucem.lib.ZoomableTextureView Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.lucem.lib.ZoomableTextureView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:430) at android.view.LayoutInflater.createView(LayoutInflater.java:645) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:426) at android.view.LayoutInflater.inflate(LayoutInflater.java:377) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:424) at android.app.Activity.setContentView(Activity.java:2451) at hbisoft.com.surfaceviewpinchzoom.MainActivity.onCreate(MainActivity.java:34) at android.app.Activity.performCreate(Activity.java:6701) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:208) at android.app.ActivityThread.main(ActivityThread.java:6267) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable at android.view.TextureView.setBackgroundDrawable(TextureView.java:345) at android.view.View.setBackground(View.java:18458) at android.view.View.<init>(View.java:4624) at android.view.View.<init>(View.java:4133) at android.view.View.<init>(View.java:4112) at android.view.TextureView.<init>(TextureView.java:151) at com.lucem.lib.ZoomableTextureView.<init>(ZoomableTextureView.java:59) at java.lang.reflect.Constructor.newInstance0(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:430)  at android.view.LayoutInflater.createView(LayoutInflater.java:645)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)  at android.view.LayoutInflater.inflate(LayoutInflater.java:518)  at android.view.LayoutInflater.inflate(LayoutInflater.java:426)  at android.view.LayoutInflater.inflate(LayoutInflater.java:377)  at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:424)  at android.app.Activity.setContentView(Activity.java:2451)  at hbisoft.com.surfaceviewpinchzoom.MainActivity.onCreate(MainActivity.java:34)  at android.app.Activity.performCreate(Activity.java:6701)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:208)  at android.app.ActivityThread.main(ActivityThread.java:6267)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) 

I added this code to ZoomableTextureView. And the error is fixed
@Override public void setBackgroundDrawable(Drawable background) { }