如何在代码中获取应用程序的hardwareAccelerated值?如何通过代码修改它?
答案 0 :(得分:2)
Window w = activity.getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
上面的代码与android:hardwareAccelerated =“true”
相同答案 1 :(得分:0)
除了上面给出的答案之外:如果canvas / view是硬件加速的,Canvas.isHardwareAccelerated()/ View.isHardwareAccelerated()将返回true。有关详细信息,请参阅http://developer.android.com/guide/topics/graphics/hardware-accel.html