72 {
73 super.onCreate(savedInstanceState);
74 setContentView(
R.layout.activity_main);
75
76 SurfaceView surfaceView = (SurfaceView) findViewById(
R.id.surfaceView);
77 surfaceView.getHolder().addCallback(this);
78 surfaceView.setOnTouchListener(this);
79
80 mDrawerLayout = (DrawerLayout) findViewById(
R.id.drawerLayout);
81 if (mDrawerLayout != null) {
82 mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
83 R.string.drawer_open,
R.string.drawer_close);
84 mDrawerLayout.addDrawerListener(mDrawerToggle);
85 getActionBar().setDisplayHomeAsUpEnabled(true);
86 getActionBar().setHomeButtonEnabled(true);
87 }
88
89 mDrawerList = (ListView) findViewById(
R.id.leftDrawer);
90 mStateAdapter = new StateAdapter(this);
91 mDrawerList.setAdapter(mStateAdapter);
92
93 mApplication = (ViewerApplication) getApplication();
95 }
void setViewerActivity(ViewerActivity viewerActivity)