TextureView with camera preview

女生的网名这么多〃 提交于 2019-12-01 21:27:00

try using this...

<uses-feature
        android:name="android.hardware.camera"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false"/>

<application
        android:name=".app.ExampleApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppTheme"
        android:hardwareAccelerated="true" >

This worked for me

You should set this in you manifest.xml.

android:hardwareAccelerated="true"

Where you declare this it's up to where you want to use your TextureView,you used it in your service.so you should declare this in your service declaration.

<service android:hardwareAccelerated="true"
 /> 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!