Skip to content

Commit

Permalink
android: finish the activity to exit by back button
Browse files Browse the repository at this point in the history
  • Loading branch information
sliverappbar committed Nov 11, 2023
1 parent 64bd727 commit 195f654
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/pages/after_loading/afterloading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -299,6 +300,10 @@ class AfterLoadingPageState extends State<AfterLoadingPage>

if (_lastPopAt != null &&
now.difference(_lastPopAt!) <= const Duration(seconds: 2)) {
if (Platform.isAndroid) {
await PlatformMiscMethods.instance.finishMainActivity();
}

return true;
}

Expand Down

0 comments on commit 195f654

Please sign in to comment.