github.com/cybriq/giocore@v0.0.7-0.20210703034601-cfb9cb5f3900/app/internal/wm/GioActivity.java (about) 1 // SPDX-License-Identifier: Unlicense OR MIT 2 3 package org.gioui; 4 5 import android.app.Activity; 6 import android.os.Bundle; 7 import android.content.res.Configuration; 8 9 public final class GioActivity extends Activity { 10 private GioView view; 11 12 @Override public void onCreate(Bundle state) { 13 super.onCreate(state); 14 15 this.view = new GioView(this); 16 17 setContentView(view); 18 } 19 20 @Override public void onDestroy() { 21 view.destroy(); 22 super.onDestroy(); 23 } 24 25 @Override public void onStart() { 26 super.onStart(); 27 view.start(); 28 } 29 30 @Override public void onStop() { 31 view.stop(); 32 super.onStop(); 33 } 34 35 @Override public void onConfigurationChanged(Configuration c) { 36 super.onConfigurationChanged(c); 37 view.configurationChanged(); 38 } 39 40 @Override public void onLowMemory() { 41 super.onLowMemory(); 42 GioView.onLowMemory(); 43 } 44 45 @Override public void onBackPressed() { 46 if (!view.backPressed()) 47 super.onBackPressed(); 48 } 49 }