mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +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 questNativeOnResume();
|
||||||
private native void questOnAppAfterLoad();
|
private native void questOnAppAfterLoad();
|
||||||
|
|
||||||
|
|
||||||
private SurfaceView mView;
|
private SurfaceView mView;
|
||||||
private SurfaceHolder mSurfaceHolder;
|
private SurfaceHolder mSurfaceHolder;
|
||||||
|
|
||||||
|
@ -57,12 +56,15 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
setContentView(mView);
|
setContentView(mView);
|
||||||
questOnAppAfterLoad();
|
questOnAppAfterLoad();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
Log.w(TAG, "QQQ onDestroy");
|
Log.w(TAG, "QQQ onDestroy");
|
||||||
|
isPausing=false;
|
||||||
|
super.onStop();
|
||||||
nativeOnSurfaceChanged(null);
|
nativeOnSurfaceChanged(null);
|
||||||
|
|
||||||
Log.w(TAG, "QQQ onDestroy -- SUPER onDestroy");
|
Log.w(TAG, "QQQ onDestroy -- SUPER onDestroy");
|
||||||
|
@ -78,6 +80,7 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
|
|
||||||
questNativeOnResume();
|
questNativeOnResume();
|
||||||
nativeOnResume();
|
nativeOnResume();
|
||||||
|
isPausing=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,40 +90,41 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
|
|
||||||
questNativeOnPause();
|
questNativeOnPause();
|
||||||
nativeOnPause();
|
nativeOnPause();
|
||||||
|
isPausing=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop(){
|
protected void onStop(){
|
||||||
super.onStop();
|
super.onStop();
|
||||||
Log.w(TAG, "QQQ Onstop called");
|
Log.w(TAG, "QQQ_ Onstop called");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestart(){
|
protected void onRestart() {
|
||||||
super.onRestart();
|
super.onRestart();
|
||||||
Log.w(TAG, "QQQ onRestart called ****");
|
Log.w(TAG, "QQQ_ onRestart called ****");
|
||||||
questOnAppAfterLoad();
|
questOnAppAfterLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
Log.w(TAG, "QQQ surfaceCreated ************************************");
|
Log.w(TAG, "QQQ_ surfaceCreated ************************************");
|
||||||
nativeOnSurfaceChanged(holder.getSurface());
|
nativeOnSurfaceChanged(holder.getSurface());
|
||||||
mSurfaceHolder = holder;
|
mSurfaceHolder = holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||||
Log.w(TAG, "QQQ surfaceChanged");
|
Log.w(TAG, "QQQ_ surfaceChanged");
|
||||||
nativeOnSurfaceChanged(holder.getSurface());
|
nativeOnSurfaceChanged(holder.getSurface());
|
||||||
mSurfaceHolder = holder;
|
mSurfaceHolder = holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
Log.w(TAG, "QQQ surfaceDestroyed ***************************************************");
|
Log.w(TAG, "QQQ_ surfaceDestroyed ***************************************************");
|
||||||
nativeOnSurfaceChanged(null);
|
// nativeOnSurfaceChanged(null);
|
||||||
mSurfaceHolder = 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.
|
public final String QT_ANDROID_DEFAULT_THEME = QT_ANDROID_THEMES[0]; // sets the default theme.
|
||||||
private QtActivityLoader m_loader = new QtActivityLoader(this);
|
private QtActivityLoader m_loader = new QtActivityLoader(this);
|
||||||
|
|
||||||
|
public boolean isPausing=false;
|
||||||
public QtActivity() {
|
public QtActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,8 +651,12 @@ public class QtActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
|
|
||||||
|
if(!isPausing){
|
||||||
QtApplication.invokeDelegate();
|
QtApplication.invokeDelegate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue