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.rs.test;
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.Log;
30import android.view.Menu;
31import android.view.MenuItem;
32import android.view.View;
33import android.view.Window;
34import android.widget.Button;
35import android.widget.ListView;
36
37import java.lang.Runtime;
38
39public class RSTest extends Activity {
40    //EventListener mListener = new EventListener();
41
42    private static final String LOG_TAG = "RSTest";
43    private static final boolean DEBUG  = false;
44    private static final boolean LOG_ENABLED = false;
45
46    private RSTestView mView;
47
48    // get the current looper (from your Activity UI thread for instance
49
50    @Override
51    public void onCreate(Bundle icicle) {
52        super.onCreate(icicle);
53
54        // Create our Preview view and set it as the content of our
55        // Activity
56        mView = new RSTestView(this);
57        setContentView(mView);
58    }
59
60    @Override
61    protected void onResume() {
62        // Ideally a game should implement onResume() and onPause()
63        // to take appropriate action when the activity loses focus
64        super.onResume();
65        mView.resume();
66    }
67
68    @Override
69    protected void onPause() {
70        // Ideally a game should implement onResume() and onPause()
71        // to take appropriate action when the activity loses focus
72        super.onPause();
73        mView.pause();
74    }
75
76    @Override
77    protected void onStop() {
78        // Actually kill the app if we are stopping. We don't want to
79        // continue/resume this test ever. It should always start fresh.
80        finish();
81        super.onStop();
82    }
83
84    static void log(String message) {
85        if (LOG_ENABLED) {
86            Log.v(LOG_TAG, message);
87        }
88    }
89
90
91}
92