1 /*
2  * Copyright (C) 2008 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.modelviewer;
18 
19 import android.renderscript.RSSurfaceView;
20 import android.renderscript.RenderScript;
21 
22 import android.app.Activity;
23 import android.content.res.Configuration;
24 import android.os.Bundle;
25 import android.os.Handler;
26 import android.os.Looper;
27 import android.os.Message;
28 import android.provider.Settings.System;
29 import android.util.Log;
30 import android.view.Menu;
31 import android.view.MenuItem;
32 import android.view.View;
33 import android.view.Window;
34 import android.widget.Button;
35 import android.widget.ListView;
36 
37 import java.lang.Runtime;
38 
39 public class SceneGraph extends Activity {
40 
41     private SceneGraphView mView;
42 
43     @Override
onCreate(Bundle icicle)44     public void onCreate(Bundle icicle) {
45         super.onCreate(icicle);
46 
47         // Create our Preview view and set it as the content of our
48         // Activity
49         mView = new SceneGraphView(this);
50         setContentView(mView);
51     }
52 
53     @Override
onResume()54     protected void onResume() {
55         // Ideally a game should implement onResume() and onPause()
56         // to take appropriate action when the activity looses focus
57         super.onResume();
58         mView.resume();
59     }
60 
61     @Override
onPause()62     protected void onPause() {
63         // Ideally a game should implement onResume() and onPause()
64         // to take appropriate action when the activity looses focus
65         super.onPause();
66         mView.pause();
67     }
68 
69 }
70 
71