mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2026-09-24 18:01:51 +00:00
Replaced System.Exit calls with FinishAffinity and Start Activity calls
Implemented "RestartApp" method defined in NavigationHelper.java. This method is used in ExitActivity.java and ContentSettingsFragment.java
This commit is contained in:
committed by
Daniel Butler
parent
547a1a9970
commit
90de75968d
@@ -599,4 +599,16 @@ public final class NavigationHelper {
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finish this <code>Activity</code> as well as all <code>Activities</code> running below it
|
||||
* and then start <code>MainActivity</code>.
|
||||
*
|
||||
* @param activity the activity to finish
|
||||
*/
|
||||
public static void restartApp(final Activity activity) {
|
||||
activity.finishAffinity();
|
||||
final Intent intent = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user