gt:         ImageData imageData = new ImageData();
context: package org.theiner.quick3d;
  
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.graphics.Canvas;
  import android.graphics.Color;
  import android.graphics.Paint;
  import android.graphics.Point;
  import android.graphics.Rect;
  import android.net.Uri;
  import android.os.Build;
  import android.os.Bundle;
  import android.view.Display;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.ImageView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import org.theiner.quick3d.asynch.ImageData;
  import org.theiner.quick3d.asynch.ImageSaver;
  import org.theiner.quick3d.asynch.ImageType;
  
  import java.io.File;
  import java.io.FileOutputStream;
  import java.io.OutputStream;
  
  
  public class ShowFotos extends Activity {
  
      private String _filename;
      private Bitmap firstBitmap;
      private Bitmap secondBitmap;
      private ImageView ivLeft;
      private ImageView ivRight;
  
      private ImageView ivClose;
      private ImageView ivSwitch;
      private ImageView ivAnaglyph;
      private ImageView ivWiggle;
      private ImageView ivCardboard;
      private ImageView ivShare;
      private ImageView ivSave;
      private TextView tvCurrent;
  
      Q3DApplication myApp;
      private Boolean isCrossEyed = true;
  
      private boolean showTools = true;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          myApp = ((Q3DApplication)this.getApplicationContext());
          try {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_show_fotos);
  
              if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                  View decorView = getWindow().getDecorView();
  
                  int uiOptions = decorView.getSystemUiVisibility();
                  uiOptions = uiOptions | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
                  uiOptions = uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN;
                  uiOptions = uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
                  decorView.setSystemUiVisibility(uiOptions);
              }
  
              myApp.appendTrace("ShowFotos: Super Konstruktor aufgerufen, Content View gesetzt.\n");
  
              Intent intent = getIntent();
              _filename = intent.getStringExtra(Quick3DMain.FILENAME_MESSAGE);
  
              myApp.appendTrace("ShowFotos: Intent erhalten. Filename: " + _filename + "\n");
  
              ivLeft = (ImageView) findViewById(R.id.ivLeft);
              ivRight = (ImageView) findViewById(R.id.ivRight);
              ivClose = (ImageView) findViewById(R.id.ivClose);
              ivSwitch = (ImageView) findViewById(R.id.ivSwitch);
              ivAnaglyph = (ImageView) findViewById(R.id.ivAnaglyph);
              ivWiggle = (ImageView) findViewById(R.id.ivWiggle);
              ivCardboard = (ImageView) findViewById(R.id.ivCardboard);
              ivShare = (ImageView) findViewById(R.id.ivShare);
              ivSave = (ImageView) findViewById(R.id.ivSave);
              tvCurrent = (TextView) findViewById(R.id.tvCurrent);
  
              myApp.appendTrace("ShowFotos: Image Views gefunden.\n");
  
              firstBitmap = myApp.getRightEyeBitmap();
              ivLeft.setImageBitmap(firstBitmap);
  
              myApp.appendTrace("ShowFotos: Rechtes Foto eingebunden.\n");
  
              secondBitmap = myApp.getLeftEyeBitmap();
              ivRight.setImageBitmap(secondBitmap);
  
              myApp.appendTrace("ShowFotos: Linkes Foto eingebunden.\n");
  
              ivClose.setImageResource(R.drawable.icon_close);
              ivSwitch.setImageResource(R.drawable.icon_switch);
              ivAnaglyph.setImageResource(R.drawable.icon_anaglyph);
              ivWiggle.setImageResource(R.drawable.icon_wiggle);
              ivCardboard.setImageResource(R.drawable.icon_cardboard);
              ivShare.setImageResource(R.drawable.icon_share);
              ivSave.setImageResource(R.drawable.icon_save);
  
              tvCurrent.setText(R.string.crosseyed);
  
              if(myApp.getCrossEyedSaved()) {
                  // Save Button verstecken
                  ivSave.setVisibility(View.INVISIBLE);
              }
  
              myApp.appendTrace("ShowFotos: Image Resourcen gesetzt.\n");
  
          } catch(Throwable e) {
              StackTraceElement se = e.getStackTrace()[0];
              myApp.prependTrace(e.toString() + "\n" + se.getClassName() + ":" + se.getLineNumber() + "\n\n");
              Helper.showTraceDialog(myApp, this);
          }
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          return true;
      }
  
      public void onClose(View view) {
          Helper.showMessageOnClose(this);
      }
  
      public void onSwitch(View view) {
          try {
              Bitmap help = firstBitmap;
              firstBitmap = secondBitmap;
              secondBitmap = help;
              ivLeft.setImageBitmap(firstBitmap);
              ivRight.setImageBitmap(secondBitmap);
  
              isCrossEyed = !isCrossEyed;
  
              if(isCrossEyed) {
                  tvCurrent.setText(R.string.crosseyed);
                  if(myApp.getCrossEyedSaved()) {
                      ivSave.setVisibility(View.INVISIBLE);
                  } else {
                      ivSave.setVisibility(View.VISIBLE);
                  }
              } else {
                  tvCurrent.setText(R.string.paralleleyed);
                  if(myApp.getParallelEyedSaved()) {
                      ivSave.setVisibility(View.INVISIBLE);
                  } else {
                      ivSave.setVisibility(View.VISIBLE);
                  }
              }
  
              myApp.appendTrace("ShowFotos: Seiten gewechselt\n");
          } catch(Throwable e) {
              StackTraceElement se = e.getStackTrace()[0];
              myApp.prependTrace(e.toString() + "\n" + se.getClassName() + ":" + se.getLineNumber() + "\n\n");
              Helper.showTraceDialog(myApp, this);
          }
      }
  
      public void onAnaglyph(View view) {
          try {
              Intent intent = new Intent(this, ShowAnaglyph.class);
              intent.putExtra(Quick3DMain.FILENAME_MESSAGE, _filename);
              startActivity(intent);
              myApp.appendTrace("ShowFotos: Auf Anaglyph gewechselt. Finish\n");
              finish();
          } catch(Throwable e) {
              StackTraceElement se = e.getStackTrace()[0];
              myApp.prependTrace(e.toString() + "\n" + se.getClassName() + ":" + se.getLineNumber() + "\n\n");
              Helper.showTraceDialog(myApp, this);
          }
      }
  
      public void onCardboard(View view) {
          try {
              Intent intent = new Intent(this, ShowCardboard.class);
              intent.putExtra(Quick3DMain.FILENAME_MESSAGE, _filename);
              startActivity(intent);
              myApp.appendTrace("ShowFotos: Auf Cardboard gewechselt. Finish\n");
              finish();
          } catch(Throwable e) {
              StackTraceElement se = e.getStackTrace()[0];
              myApp.prependTrace(e.toString() + "\n" + se.getClassName() + ":" + se.getLineNumber() + "\n\n");
              Helper.showTraceDialog(myApp, this);
          }
      }
  
      public void onWiggle(View view) {
          try {
              Intent intent = new Intent(this, ShowWiggle.class);
              intent.putExtra(Quick3DMain.FILENAME_MESSAGE, _filename);
              startActivity(intent);
              myApp.appendTrace("ShowFotos: Auf Wiggle gewechselt. Finish\n");
              finish();
          } catch(Throwable e) {
              StackTraceElement se = e.getStackTrace()[0];
              myApp.prependTrace(e.toString() + "\n" + se.getClassName() + ":" + se.getLineNumber() + "\n\n");
              Helper.showTraceDialog(myApp, this);
          }
      }
  
      private void doSave(final boolean toBeShared) {
          ivSave.setVisibility(View.INVISIBLE);
          final ShowFotos that = this;
          ImageSaver.SaveCompleteListener scl = new ImageSaver.SaveCompleteListener() {
              @Override
              public void onSaveComplete(String result) {
                  Toast.makeText(that, getString(R.string.foto_saved),
                          Toast.LENGTH_LONG).show();
  
                  if(toBeShared) {
                      doShare();
                  }
              }
          };
  
  