Fix refresh top scene
This commit is contained in:
1 file changed
+11
-5
@@ -17,6 +17,7 @@
|
||||
package com.hippo.scene;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -556,11 +557,16 @@ public abstract class StageActivity extends EhActivity {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
Fragment fragment = fragmentManager.findFragmentByTag(tag);
|
||||
|
||||
FragmentTransaction transaction = fragmentManager.beginTransaction();
|
||||
transaction.detach(fragment);
|
||||
transaction.attach(fragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
onTransactScene();
|
||||
if (fragment == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
|
||||
fragmentManager.beginTransaction().detach(fragment).commitAllowingStateLoss();
|
||||
fragmentManager.beginTransaction().attach(fragment).commitAllowingStateLoss();
|
||||
}else{
|
||||
fragmentManager.beginTransaction().detach(fragment).attach(fragment).commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user