Fixed the app restarting not working properly
* Using [``process-phoenix``](https://github.com/JakeWharton/ProcessPhoenix)
This commit is contained in:
parent
6a1d81fcf3
commit
fda0a550fd
4 changed files with 19 additions and 3 deletions
|
|
@ -58,6 +58,8 @@ import java.util.ArrayList;
|
|||
|
||||
import static org.schabi.newpipe.util.external_communication.ShareUtils.installApp;
|
||||
|
||||
import com.jakewharton.processphoenix.ProcessPhoenix;
|
||||
|
||||
public final class NavigationHelper {
|
||||
public static final String MAIN_FRAGMENT_TAG = "main_fragment_tag";
|
||||
public static final String SEARCH_FRAGMENT_TAG = "search_fragment_tag";
|
||||
|
|
@ -607,8 +609,7 @@ public final class NavigationHelper {
|
|||
*/
|
||||
public static void restartApp(final Activity activity) {
|
||||
NewPipeDatabase.close();
|
||||
activity.finishAffinity();
|
||||
final Intent intent = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(intent);
|
||||
|
||||
ProcessPhoenix.triggerRebirth(activity.getApplicationContext());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue