Hide keyboard when not searching (#5036)

This commit is contained in:
peakvalleytech 2021-06-28 12:54:11 -07:00 committed by GitHub
parent d041b86114
commit 1fbc565bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,15 +3,16 @@ package de.danoeh.antennapod.activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.Menu;
import android.view.MenuItem;
import android.view.inputmethod.InputMethodManager;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
import android.provider.Settings;
import android.view.Menu;
import android.view.MenuItem;
import com.bytehamster.lib.preferencesearch.SearchPreferenceResult;
import com.bytehamster.lib.preferencesearch.SearchPreferenceResultListener;
@ -136,6 +137,10 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
finish();
} else {
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
if (imm.isActive()) {
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_NOT_ALWAYS);
}
getSupportFragmentManager().popBackStack();
}
return true;