Where do you perform this test relative to the activity's lifecycle? The method will not return true until the view has been attached to a hardware accelerated window. The activity's onCreate is too early for that, so you get false.
-- Kostya 24 ноября 2011 г. 16:50 пользователь New Developer <[email protected]>написал: > Just tested the same code on a Sony S same thing > So with both the Sony S and Motorola Xoom > > You hear the audio , but see No video > hardware is accelerated and first time around I get the following message > in LogCat > > 11-24 07:49:23.688: E/Surface(11158): surface (identity=1931) is invalid, > err=-19 (No such device) > 11-24 07:49:23.688: D/CallStack(11158): Surface#00 pc 00013b5e > /system/lib/libsurfaceflinger_client.so > 11-24 07:49:23.688: D/CallStack(11158): Surface#01 pc 00013b9c > /system/lib/libsurfaceflinger_client.so > 11-24 07:49:23.688: D/CallStack(11158): Surface#02 pc 00013c1a > /system/lib/libsurfaceflinger_client.so > 11-24 07:49:23.688: D/CallStack(11158): Surface#03 pc 00004f38 > /system/lib/libEGL.so > 11-24 07:49:23.688: D/CallStack(11158): Surface#04 pc 00036dca > /system/lib/libandroid_runtime.so > 11-24 07:49:23.898: D/MediaPlayer(11158): getMetadata > > > Thanks again to all > > > On 11/23/2011 11:33 PM, Romain Guy wrote: > > On what device are you testing this? > > On Wed, Nov 23, 2011 at 7:01 PM, New Developer <[email protected]> wrote: > >> 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 >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > > > -- > Romain Guy > Android framework engineer > [email protected] > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

