7.4. MainActivity Class
This app consists of six classes:
• MainActivity (Fig. 7.11)—Serves as the parent Activity for this app’s Fragments.
1 // MainActivity.java 2 // Sets MainActivity's layout 3 package com.deitel.doodlz; 4 5 import android.app.Activity; 6 import android.content.pm.ActivityInfo; 7 import android.content.res.Configuration; 8 import android.os.Bundle; 9 10 public class MainActivity extends Activity11 {12 @Override13 protected void onCreate(Bundle savedInstanceState)14 {15 super.onCreate(savedInstanceState);16 setContentView(R.layout.activity_main);17 18 // determine screen size19 int screenSize =20 getResources().getConfiguration().screenLayout ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access