From 1cc912562fc5c93aa664b5bc7f465ac26aeba17d Mon Sep 17 00:00:00 2001 From: Twaik Yont Date: Mon, 15 Jul 2024 21:12:59 +0300 Subject: [PATCH] Fixing Back key in Settings on Meta Oculus devices --- app/src/main/java/com/termux/x11/LoriePreferences.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/x11/LoriePreferences.java b/app/src/main/java/com/termux/x11/LoriePreferences.java index f9c0b0841..3eca698fd 100644 --- a/app/src/main/java/com/termux/x11/LoriePreferences.java +++ b/app/src/main/java/com/termux/x11/LoriePreferences.java @@ -154,7 +154,11 @@ public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { - onBackPressed(); + if (getSupportFragmentManager().getBackStackEntryCount() == 0) + finish(); + else + onBackPressed(); + return true; }