Finish HTML viewer task

pull/214/head
M66B 1 year ago
parent b2e95082c5
commit cba49802b1

@ -31,6 +31,7 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.Group;
import androidx.preference.PreferenceManager;
@ -58,6 +59,13 @@ public class ActivityHTML extends ActivityBase {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
finishAndRemoveTask();
}
});
View view = LayoutInflater.from(this).inflate(R.layout.activity_text, null);
setContentView(view);
@ -106,7 +114,7 @@ public class ActivityHTML extends ActivityBase {
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
if (itemId == android.R.id.home) {
finish();
finishAndRemoveTask();
return true;
} else if (itemId == R.id.menu_sanitize) {
sanitize = !sanitize;

Loading…
Cancel
Save