Home | History | Annotate | Download | only in film
      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.film;
     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.Config;
     30 import android.util.Log;
     31 import android.view.Menu;
     32 import android.view.MenuItem;
     33 import android.view.View;
     34 import android.view.Window;
     35 import android.widget.Button;
     36 import android.widget.ListView;
     37 
     38 import java.lang.Runtime;
     39 
     40 public class Film extends Activity {
     41     //EventListener mListener = new EventListener();
     42 
     43     private static final String LOG_TAG = "libRS_jni";
     44     private static final boolean DEBUG  = false;
     45     private static final boolean LOG_ENABLED = DEBUG ? Config.LOGD : Config.LOGV;
     46 
     47     private FilmView mView;
     48 
     49     // get the current looper (from your Activity UI thread for instance
     50 
     51 
     52 
     53     @Override
     54     public void onCreate(Bundle icicle) {
     55         super.onCreate(icicle);
     56 
     57         // Create our Preview view and set it as the content of our
     58         // Activity
     59         mView = new FilmView(this);
     60         setContentView(mView);
     61     }
     62 
     63     @Override
     64     protected void onResume() {
     65         // Ideally a game should implement onResume() and onPause()
     66         // to take appropriate action when the activity looses focus
     67         super.onResume();
     68         mView.onResume();
     69     }
     70 
     71     @Override
     72     protected void onPause() {
     73         // Ideally a game should implement onResume() and onPause()
     74         // to take appropriate action when the activity looses focus
     75         super.onPause();
     76         mView.onPause();
     77 
     78         Runtime.getRuntime().exit(0);
     79     }
     80 
     81 
     82     static void log(String message) {
     83         if (LOG_ENABLED) {
     84             Log.v(LOG_TAG, message);
     85         }
     86     }
     87 
     88 
     89 }
     90 
     91