Wednesday, November 23, 2011

Re: [android-developers] hardware acceleration

My mainfest has

    <application  android:icon="@drawable/logo"       android:hardwareAccelerated="true"   android:label="@string/app_name" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar">
        <activity android:name="MainActivity"                 android:hardwareAccelerated="true"  android:screenOrientation="landscape"  android:configChanges="orientation" ></activity> 
        <activity android:name="Display"                      android:hardwareAccelerated="true"  android:screenOrientation="landscape"  android:configChanges="orientation" ></activity>  


From MainActivity I call Display  using intent

            Intent intent = new Intent();
            intent.setClass(getApplicationContext(), Display.class);  
            startActivity(intent);

Display class has

public class Display extends Activity {
    private FrameLayout parent;
    private String      fName;
    public   static  VideoView  video;
   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        fName = CURRENT_IMAGE;
        setContentView(R.layout.image_viewer);
       
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED , WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
       
        parent = (FrameLayout) findViewById(R.id.image);
        parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
Log.e("display", "parent   is  " + parent.isHardwareAccelerated());
        video  = (VideoView) findViewById(R.id.video);
Log.e("display", "video    is  " + video.isHardwareAccelerated());

Log.e("display", "image    is  " + image.isHardwareAccelerated());
        image.setLayerType(View.LAYER_TYPE_HARDWARE, null);
Log.e("display", "image    is  " + image.isHardwareAccelerated());
        parent.setOnTouchListener(image);

From my reading and understanding of Hardware acceleration I have done everything to  enable hardware acceleration
yet  from LogCat

parent is false
video   is false
image  is false
image  is false

Why  ? ?

thanks in advance

No comments:

Post a Comment