@@ -535,6 +535,10 @@ public void onResume() {
535
535
// Don't call resume() when the app is starting and setup() has not been
536
536
// called yet
537
537
// https://github.com/processing/processing-android/issues/274
538
+
539
+ // Also, no need to call resume() from anywhere else (for example, from
540
+ // onStart) since onResume() is always called in the activity lifecyle:
541
+ // https://developer.android.com/guide/components/activities/activity-lifecycle.html
538
542
resume ();
539
543
}
540
544
}
@@ -698,7 +702,6 @@ public int sketchSmooth() {
698
702
699
703
700
704
final public boolean sketchFullScreen () {
701
- //return false;
702
705
return fullScreen ;
703
706
}
704
707
@@ -731,10 +734,6 @@ final public int sketchPixelDensity() {
731
734
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
732
735
733
736
734
- // public interface SketchSurfaceView {
735
- // public PGraphics getGraphics();
736
- // }
737
-
738
737
public void surfaceChanged () {
739
738
surfaceChanged = true ;
740
739
}
@@ -762,24 +761,18 @@ public void surfaceWindowFocusChanged(boolean hasFocus) {
762
761
* then motionX, motionY, motionPressed, and motionEvent will not be set.
763
762
*/
764
763
public boolean surfaceTouchEvent (MotionEvent event ) {
765
- // println(event);
766
764
nativeMotionEvent (event );
767
- // return super.onTouchEvent(event);
768
765
return true ;
769
766
}
770
767
771
768
772
769
public void surfaceKeyDown (int code , android .view .KeyEvent event ) {
773
- // System.out.println("got onKeyDown for " + code + " " + event);
774
770
nativeKeyEvent (event );
775
- // return super.onKeyDown(code, event);
776
771
}
777
772
778
773
779
774
public void surfaceKeyUp (int code , android .view .KeyEvent event ) {
780
- // System.out.println("got onKeyUp for " + code + " " + event);
781
775
nativeKeyEvent (event );
782
- // return super.onKeyUp(code, event);
783
776
}
784
777
785
778
@@ -795,7 +788,6 @@ public void surfaceKeyUp(int code, android.view.KeyEvent event) {
795
788
* PAppletGL needs to have a usable screen before getting things rolling.
796
789
*/
797
790
public void start () {
798
- resume ();
799
791
surface .resumeThread ();
800
792
}
801
793
@@ -811,7 +803,6 @@ public void start() {
811
803
public void stop () {
812
804
// this used to shut down the sketch, but that code has
813
805
// been moved to dispose()
814
- pause ();
815
806
surface .pauseThread ();
816
807
817
808
//TODO listeners
@@ -833,39 +824,6 @@ public void pause() {
833
824
public void resume () {
834
825
}
835
826
836
- /**
837
- * Called by the browser or applet viewer to inform this applet
838
- * that it is being reclaimed and that it should destroy
839
- * any resources that it has allocated.
840
- * <p/>
841
- * This also attempts to call PApplet.stop(), in case there
842
- * was an inadvertent override of the stop() function by a user.
843
- * <p/>
844
- * destroy() supposedly gets called as the applet viewer
845
- * is shutting down the applet. stop() is called
846
- * first, and then destroy() to really get rid of things.
847
- * no guarantees on when they're run (on browser quit, or
848
- * when moving between pages), though.
849
- */
850
- // public void destroy() {
851
- // ((PApplet)this).exit();
852
- // }
853
-
854
-
855
- /**
856
- * This returns the last width and height specified by the user
857
- * via the size() command.
858
- */
859
- // public Dimension getPreferredSize() {
860
- // return new Dimension(width, height);
861
- // }
862
-
863
-
864
- // public void addNotify() {
865
- // super.addNotify();
866
- // println("addNotify()");
867
- // }
868
-
869
827
870
828
//////////////////////////////////////////////////////////////
871
829
0 commit comments