title: Detect Hardware Acceleration at Runtime: Android
body: <p>Is it possible to consistently detect if an Activity has hardware acceleration enabled when it is created? I'm worried that users of my library will enable it through the manifest when they shouldn't, by not specifically disabling it for my Activity (as I instruct them to do.)</p>
  
  <p>The only solid information I can find (<a href="http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html">http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html</a>) says that I can query <code>View.isHardwareAccelerated()</code> and <code>Canvas.isHardwareAccelerated()</code>. However, for my purposes, I would like to ensure it is off when my library's Activity is shown. So far, I can't get anything to report a consistent yes/no when it is on or off. I tried hacking in a dummy view, setting it to my activity and then testing it, but it always returns false. Also, I tried testing <code>Window.getAttributes( ).flags</code>, but they aren't showing it either.</p>
  
  <p>I am testing this because the hardware accelerated draw path for my library doesn't function correctly, and there doesn't seem like there is any way to fix it.</p>