mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 07:02:46 +02:00
Merge pull request #14975 from amerhifi/LifeCyclePause
case 21032: Life cycle pause
This commit is contained in:
commit
6f5d0b7191
2 changed files with 20 additions and 11 deletions
|
@ -34,7 +34,6 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
private native void questNativeOnResume();
|
||||
private native void questOnAppAfterLoad();
|
||||
|
||||
|
||||
private SurfaceView mView;
|
||||
private SurfaceHolder mSurfaceHolder;
|
||||
|
||||
|
@ -57,12 +56,15 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
setContentView(mView);
|
||||
questOnAppAfterLoad();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
Log.w(TAG, "QQQ onDestroy");
|
||||
|
||||
isPausing=false;
|
||||
super.onStop();
|
||||
nativeOnSurfaceChanged(null);
|
||||
|
||||
Log.w(TAG, "QQQ onDestroy -- SUPER onDestroy");
|
||||
|
@ -78,6 +80,7 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
|
||||
questNativeOnResume();
|
||||
nativeOnResume();
|
||||
isPausing=false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,40 +90,41 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
|
||||
questNativeOnPause();
|
||||
nativeOnPause();
|
||||
isPausing=true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop(){
|
||||
super.onStop();
|
||||
Log.w(TAG, "QQQ Onstop called");
|
||||
Log.w(TAG, "QQQ_ Onstop called");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestart(){
|
||||
protected void onRestart() {
|
||||
super.onRestart();
|
||||
Log.w(TAG, "QQQ onRestart called ****");
|
||||
Log.w(TAG, "QQQ_ onRestart called ****");
|
||||
questOnAppAfterLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
Log.w(TAG, "QQQ surfaceCreated ************************************");
|
||||
Log.w(TAG, "QQQ_ surfaceCreated ************************************");
|
||||
nativeOnSurfaceChanged(holder.getSurface());
|
||||
mSurfaceHolder = holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||
Log.w(TAG, "QQQ surfaceChanged");
|
||||
Log.w(TAG, "QQQ_ surfaceChanged");
|
||||
nativeOnSurfaceChanged(holder.getSurface());
|
||||
mSurfaceHolder = holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
Log.w(TAG, "QQQ surfaceDestroyed ***************************************************");
|
||||
nativeOnSurfaceChanged(null);
|
||||
mSurfaceHolder = null;
|
||||
Log.w(TAG, "QQQ_ surfaceDestroyed ***************************************************");
|
||||
// nativeOnSurfaceChanged(null);
|
||||
// mSurfaceHolder = null;
|
||||
|
||||
}
|
||||
}
|
|
@ -70,6 +70,7 @@ public class QtActivity extends Activity {
|
|||
public final String QT_ANDROID_DEFAULT_THEME = QT_ANDROID_THEMES[0]; // sets the default theme.
|
||||
private QtActivityLoader m_loader = new QtActivityLoader(this);
|
||||
|
||||
public boolean isPausing=false;
|
||||
public QtActivity() {
|
||||
}
|
||||
|
||||
|
@ -650,9 +651,13 @@ public class QtActivity extends Activity {
|
|||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
QtApplication.invokeDelegate();
|
||||
|
||||
if(!isPausing){
|
||||
QtApplication.invokeDelegate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue