SceneGraph.java revision c29a4442812d5f0e9f1af13b36cb6a806b6b46e0
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
17package com.android.modelviewer;
18
19import android.renderscript.RSSurfaceView;
20import android.renderscript.RenderScript;
21
22import android.app.Activity;
23import android.content.res.Configuration;
24import android.os.Bundle;
25import android.os.Handler;
26import android.os.Looper;
27import android.os.Message;
28import android.provider.Settings.System;
29import android.util.Config;
30import android.util.Log;
31import android.view.Menu;
32import android.view.MenuItem;
33import android.view.View;
34import android.view.Window;
35import android.widget.Button;
36import android.widget.ListView;
37
38import java.lang.Runtime;
39
40public class SceneGraph extends Activity {
41
42    private SceneGraphView mView;
43
44    @Override
45    public void onCreate(Bundle icicle) {
46        super.onCreate(icicle);
47
48        // Create our Preview view and set it as the content of our
49        // Activity
50        mView = new SceneGraphView(this);
51        setContentView(mView);
52    }
53
54    @Override
55    protected void onResume() {
56        // Ideally a game should implement onResume() and onPause()
57        // to take appropriate action when the activity looses focus
58        super.onResume();
59        mView.resume();
60    }
61
62    @Override
63    protected void onPause() {
64        // Ideally a game should implement onResume() and onPause()
65        // to take appropriate action when the activity looses focus
66        super.onPause();
67        mView.pause();
68    }
69
70}
71
72