mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-22 11:02:35 +01:00
Add close() method to NewPipeDatabase
This commit is contained in:
parent
7c3f5a62c5
commit
9ca2691a2c
@ -51,4 +51,15 @@ public final class NewPipeDatabase {
|
||||
throw new RuntimeException("Checkpoint was blocked from completing");
|
||||
}
|
||||
}
|
||||
|
||||
public static void close() {
|
||||
if (databaseInstance != null) {
|
||||
synchronized (NewPipeDatabase.class) {
|
||||
if (databaseInstance != null) {
|
||||
databaseInstance.close();
|
||||
databaseInstance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ public final class NavigationHelper {
|
||||
* @param activity the activity to finish
|
||||
*/
|
||||
public static void restartApp(final Activity activity) {
|
||||
NewPipeDatabase.getInstance(activity).close();
|
||||
NewPipeDatabase.close();
|
||||
activity.finishAffinity();
|
||||
final Intent intent = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(intent);
|
||||
|
Loading…
Reference in New Issue
Block a user