I would like to use TextureView to show camera preview in it. Finally i want to set opacity for camera preview, using TextureView. But i have problem:
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"
/>
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