Search code examples
androidrenderinggpuandroid-4.0-ice-cream-sandwich

Find out if "Force GPU-Rendering" is enabled


Since Ice-Cream-Sandwich there is a developer-option called "force GPU-rendering". If enabled it refuses to Display some large Drawables. Therefore I want to find out, if this option is enabled, to inform the User that he has to switch it off, if he wants to see that drawable.


Solution

  • Find a View that you know shouldn't be accelerated, which should be any View if you add

    android:hardwareAccelerated="false"
    

    to your <application> in Android Manifest, then in your code, call

    view.isHardwareAccelerated();
    

    If it returns true, the option is set as on. This has been confirmed to work on my Galaxy Nexus.