Android TextureView和硬件加速

时间:2013-01-27 20:06:17

标签: android hardware-acceleration

我正在尝试实施this page上显示的示例。我试过运行android 4及更高版本的三个不同的设备,并且在所有情况下我得到一个带有此警告的黑屏:

01-27 20:01:22.683: W/TextureView(4728): A TextureView or a subclass can only be used with hardware acceleration enabled.

我在应用程序清单中打开了硬件加速:

<application
    android:hardwareAccelerated="true"
    [etc...]

但是下面检查我的自定义视图的onAttachedToWindow方法总是返回false

private class MyTextureView extends TextureView
{
    public MyTextureView(Context context) {
        super(context);
    }

    @Override
    protected void onAttachedToWindow()
    {
        super.onAttachedToWindow();
        Log.d("", Boolean.toString(mTextureView.isHardwareAccelerated()));          
    }
}

有谁知道这里有什么问题?

由于

1 个答案:

答案 0 :(得分:0)

如果您使用Emulator进行测试,请检查硬件加速配置。 请查看此主题以获取更多信息: http://developer.android.com/tools/devices/emulator.html#acceleration

相关问题