



This is the only thing left that's bugging me. In order to get fullscreen on-the-fly, I set a static bool flag in my class, then 'restart' the activity, and set up everything before calling setContentView(). This works fine on the emulator, just like the freeze issue, however on the device, it closes the activity/app, leaving only the Android homescreen. It happens on the first or second try when toggling fullscreen. One weird thing: if I start my activity fullscreen first, then deactivate fullscreen, and so on, it works. However, if I start the app in non-fullscreen mode, then I go to fullscreen, and then back, it kindof closes the app (i.e. shows home screen).

zorro wrote:You can switch to fullscreen in two ways, from the app or using the manifest file.
1. In activity onCreate function:Using java Syntax Highlighting
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // set fullscreen this.requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); (...) Parsed in 0.035 seconds, using GeSHi 1.0.8.4
OR
2. In manifest file:Using xml Syntax Highlighting
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> Parsed in 0.001 seconds, using GeSHi 1.0.8.4
That's it.. Both methods work just fine. Second method is better I guess because the app starts fullscreen. The first method sets the fullscreen after the window appears (and also someone here on the forum said that the performance is lower too). I didn't notice performance differences between the two methods, but I reccomend the second method (which i'm also using right now).

zorro wrote:That sample is hot handling the screen rotation and this is the reason for the crash. The sample is just setting things up, but is assuming that you don't change the orientation. I tried the sample on a G1 with Android 1.6 and it freezes after a few switches, just like you said. Then I added the lineUsing xml Syntax Highlighting
android:configChanges="orientation|keyboardHidden"Parsed in 0.000 seconds, using GeSHi 1.0.8.4
into the manifest in the activity tag, and now works just fine. The screen is rotating fine and the application does not crash. Just try it. The line tells the OS that your application does not need to be reseted at orientation changes.

Return to Android 2D/3D Graphics - OpenGL Tutorials
Users browsing this forum: Google [Bot] and 5 guests