Merge pull request #1482 from osodebailar/fix/plugin-preference-back-button
fix plugin preference back button
This commit is contained in:
commit
bb98586055
|
@ -63,8 +63,7 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activities.PreferencesActivity"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity android:name=".activities.PreferencesActivity" />
|
||||
<activity android:name=".plugins.general.overview.activities.QuickWizardListActivity"
|
||||
android:theme="@style/AppTheme"
|
||||
android:exported="false">
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.MenuItem
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.PreferenceScreen
|
||||
import info.nightscout.androidaps.R
|
||||
|
@ -62,4 +63,14 @@ class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompa
|
|||
private fun filterPreferences() {
|
||||
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)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue