I try into enable the acceration for my android app, but failed. my code as follows:
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tsaarni.nativeeglexample"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="21"/>
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:allowBackup="true"
android:hardwareAccelerated="true">
<activity android:name="NativeEglExample"
android:hardwareAccelerated="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And I also start window accerlation:
setContentView(R.layout.main);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
FrameLayout was created in a layout xml file, I get it but found the acceleration status ac is false:
FrameLayout globalFramelayout = (FrameLayout)findViewById(R.id.my_framelayout);
boolean ac = globalFramelayout.isHardwareAccelerated();
So, my questions are:
1. Is my judgement method correct?
2. If that's correct, why ac status is false ?