gt:         if (mGLView != null) {
context: /**
   *  Osmo on Android
   *  Aug/2010
   *  NGO Van Luyen
   * $Id$
   *
   */
  package com.gpac.Osmo4;
  
  import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.io.PrintStream;
  import java.nio.charset.Charset;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.HashMap;
  import java.util.Set;
  import java.util.Map;
  import java.util.concurrent.Callable;
  import java.util.concurrent.ExecutionException;
  import java.util.concurrent.ExecutorService;
  import java.util.concurrent.Executors;
  import java.util.concurrent.Future;
  import java.util.concurrent.TimeUnit;
  import java.util.concurrent.TimeoutException;
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.app.Dialog;
  import android.app.ProgressDialog;
  import android.content.ActivityNotFoundException;
  import android.content.Context;
  import android.content.DialogInterface;
  import android.content.DialogInterface.OnClickListener;
  import android.content.Intent;
  import android.content.pm.ActivityInfo;
  import android.content.res.Configuration;
  import android.hardware.SensorManager;
  import android.location.LocationManager;
  import android.net.Uri;
  import android.os.Bundle;
  import android.os.PowerManager;
  import android.os.PowerManager.WakeLock;
  import android.os.Vibrator;
  import android.text.InputType;
  import android.util.Log;
  import android.view.KeyEvent;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.ViewGroup;
  import android.view.Window;
  import android.view.WindowManager;
  import android.view.inputmethod.InputMethodManager;
  import android.widget.ArrayAdapter;
  import android.widget.AutoCompleteTextView;
  import android.widget.LinearLayout;
  import android.widget.Toast;
  import android.content.res.AssetManager;
  
  import com.gpac.Osmo4.Osmo4GLSurfaceView;
  import com.gpac.Osmo4.Preview;
  import com.gpac.Osmo4.R;
  import com.gpac.Osmo4.extra.FileChooserActivity;
  import com.gpac.Osmo4.logs.GpacLogger;
  
  import java.lang.reflect.InvocationTargetException;
  import java.lang.reflect.Method;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.net.URLClassLoader;
  
  import com.lge.real3d.Real3D;
  import com.lge.real3d.Real3DInfo;
  /**
   * The main Osmo4 activity, used to launch everything
   * 
   * @version $Revision$
   * 
   */
  public class Osmo4 extends Activity implements GpacCallback {
  
      // private String[] m_modules_list;
  	
  	public boolean m3DLibraryLoaded = false;
  	private Real3D mReal3D;	
  
      private boolean shouldDeleteGpacConfig = false;
  
      /**
       * @return the shouldDeleteGpacConfig
       */
      public synchronized boolean isShouldDeleteGpacConfig() {
          return shouldDeleteGpacConfig;
      }
  
      /**
       * @param shouldDeleteGpacConfig the shouldDeleteGpacConfig to set
       */
      public synchronized void setShouldDeleteGpacConfig(boolean shouldDeleteGpacConfig) {
          this.shouldDeleteGpacConfig = shouldDeleteGpacConfig;
      }
  
      private final static String CFG_STARTUP_CATEGORY = "General"; //$NON-NLS-1$
  
      private final static String CFG_STARTUP_NAME = "StartupFile"; //$NON-NLS-1$
  
      private boolean keyboardIsVisible = false;
  
      private final static int DEFAULT_BUFFER_SIZE = 8192;
  
      private GpacConfig gpacConfig;
  
      /**
       * Activity request ID for picking a file from local file system
       */
      public final static int PICK_FILE_REQUEST = 1;
  
      private final static String LOG_OSMO_TAG = "Osmo4"; //$NON-NLS-1$
  
      /**
       * List of all extensions recognized by Osmo
       */
      public final static String OSMO_REGISTERED_FILE_EXTENSIONS = "*.mp4,*.bt,*.xmt,*.xml,*.ts,*.svg,*.mp3,*.m3u8,*.mpg,*.aac,*.m4a,*.jpg,*.png,*.wrl,*.mpd"; //$NON-NLS-1$
  
      private PowerManager.WakeLock wl = null;
  
      private Osmo4GLSurfaceView mGLView;
  
      private GpacLogger logger;
  
      private ProgressDialog startupProgress;
      
      private LinearLayout gl_view;
  
      // ---------------------------------------
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          requestWindowFeature(Window.FEATURE_PROGRESS);
          requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  		
  		requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
          		WindowManager.LayoutParams.FLAG_FULLSCREEN);
          
          try {
  			Class c = Class.forName("com.lge.real3d.Real3D");
  			final String LGE_3D_DISPLAY = "lge.hardware.real3d.barrier.landscape";
  			if(this.getPackageManager().hasSystemFeature(LGE_3D_DISPLAY))
  				m3DLibraryLoaded = true;
          } 
          catch (ClassNotFoundException e) {
          	m3DLibraryLoaded = false;
          }
  
  		MPEGVSensor.myAct = this;
          MPEGVSensor.initSensorManager((SensorManager) getSystemService(Context.SENSOR_SERVICE));
  		MPEGVSensor.initLocationManager((LocationManager)getSystemService(Context.LOCATION_SERVICE));
  
          final String toOpen;
          if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
              Uri uri = getIntent().getData();
              if (uri != null) {
                  synchronized (this) {
                      toOpen = uri.toString();
                  }
              } else
                  toOpen = null;
          } else
              toOpen = null;
          if (gpacConfig == null) {
              gpacConfig = new GpacConfig(this);
              if (gpacConfig == null) {
                  Log.e(LOG_OSMO_TAG, "Failed to load GPAC config"); //$NON-NLS-1$
                  displayPopup(getResources().getString(R.string.failedToLoadGPACConfig),
                               getResources().getString(R.string.failedToLoadGPACConfig));
              } else
                  gpacConfig.ensureAllDirectoriesExist();
          }
          if (logger == null)
              logger = new GpacLogger(gpacConfig);
          logger.onCreate();
          if (startupProgress == null) {
              startupProgress = new ProgressDialog(this);
              startupProgress.setCancelable(false);
          }
          startupProgress.setMessage(getResources().getText(R.string.osmoLoading));
          startupProgress.setTitle(R.string.osmoLoading);
          startupProgress.show();
          
  