Launch splash activity after restoring backup (#7020)

This commit is contained in:
ByteHamster 2024-03-24 01:38:10 +01:00 committed by GitHub
parent a065d3fc33
commit 79856b7931
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import android.app.ProgressDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
@ -37,7 +38,6 @@ import de.danoeh.antennapod.storage.importexport.FavoritesWriter;
import de.danoeh.antennapod.storage.importexport.HtmlWriter; import de.danoeh.antennapod.storage.importexport.HtmlWriter;
import de.danoeh.antennapod.storage.importexport.OpmlWriter; import de.danoeh.antennapod.storage.importexport.OpmlWriter;
import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter;
import io.reactivex.Completable; import io.reactivex.Completable;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
@ -363,7 +363,9 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat {
} }
private void forceRestart() { private void forceRestart() {
Intent intent = new MainActivityStarter(getContext()).getIntent(); PackageManager pm = getContext().getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(getContext().getPackageName());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().getApplicationContext().startActivity(intent); getContext().getApplicationContext().startActivity(intent);
Runtime.getRuntime().exit(0); Runtime.getRuntime().exit(0);
} }