Graphics Programs Reference
In-Depth Information
To make sure the GAME MENU application takes over the entire screen and is
oriented in landscape mode, all the activity elements in the AndroidMani-
fest.xml file must include the attributes and values shown in Listing 2-3 . Table
2-1 provides the line descriptions for Listing 2-3 .
Listing 2-3. GAME MENU/AndroidManifest.xml
android:configChanges="keyboard|keyboardHidden|orientation"
android:screenOrientation="landscape"
android:theme="@android:style/
Theme.NoTitleBar.Fullscreen"
Table 2-1 . Listing 2-3 , lines description
Line
Description
Hint Android to avoid performing the default reset of activity
when the specified configurations change
1.
2.
Set landscape orientation
3.
Make the activity full-screen
Now, we move on to an important topic to discuss using OpenGL views along with
XML-based layouts and views.
Setting Views Using setContentView and ad-
dContentView
Activity content can be set to an explicit view using the setContentView meth-
od, which is a public method of the android.app.Activity class. Using this
method, a View is placed directly into the activity's view hierarchy. This View can
be as simple as a button-view ( Listing 2-4 , Figure 2-10 ) or it can itself be a complex
view hierarchy, consisting of various layouts and views within it.
Listing
2-4. SETCONTENTVIEW/src/com/apress/android/setcontentview/
Main.java
@Override
public void onCreate(Bundle savedInstanceState) {
 
 
 
 
 
 
Search WWH ::




Custom Search