From 195f65446baf72c286a3b9c2322a7781cf3d8595 Mon Sep 17 00:00:00 2001 From: SliverAppBar Date: Sat, 11 Nov 2023 23:05:06 +0900 Subject: [PATCH] android: finish the activity to exit by back button --- lib/pages/after_loading/afterloading_page.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pages/after_loading/afterloading_page.dart b/lib/pages/after_loading/afterloading_page.dart index a47f9bc7b..e1cfc0f7c 100644 --- a/lib/pages/after_loading/afterloading_page.dart +++ b/lib/pages/after_loading/afterloading_page.dart @@ -19,6 +19,7 @@ import 'package:violet/pages/main/main_page.dart'; import 'package:violet/pages/search/search_page.dart'; import 'package:violet/pages/segment/double_tap_to_top.dart'; import 'package:violet/pages/settings/settings_page.dart'; +import 'package:violet/platform/misc.dart'; import 'package:violet/script/script_webview.dart'; import 'package:violet/settings/settings.dart'; import 'package:violet/update/update_manager.dart'; @@ -299,6 +300,10 @@ class AfterLoadingPageState extends State if (_lastPopAt != null && now.difference(_lastPopAt!) <= const Duration(seconds: 2)) { + if (Platform.isAndroid) { + await PlatformMiscMethods.instance.finishMainActivity(); + } + return true; }