fix plugin preference back button

This commit is contained in:
osodebailar 2022-03-22 10:19:09 +01:00
parent 0e559eff84
commit 122ae15a6f
2 changed files with 12 additions and 2 deletions

View file

@ -63,8 +63,7 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activities.PreferencesActivity" <activity android:name=".activities.PreferencesActivity" />
android:theme="@style/AppTheme" />
<activity android:name=".plugins.general.overview.activities.QuickWizardListActivity" <activity android:name=".plugins.general.overview.activities.QuickWizardListActivity"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:exported="false"> android:exported="false">

View file

@ -4,6 +4,7 @@ import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.MenuItem
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
@ -62,4 +63,14 @@ class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompa
private fun filterPreferences() { private fun filterPreferences() {
myPreferenceFragment?.setFilter(binding.prefFilter.text.toString()) myPreferenceFragment?.setFilter(binding.prefFilter.text.toString())
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.getItemId()) {
android.R.id.home -> {
onBackPressed()
return true
}
}
return super.onOptionsItemSelected(item)
}
} }