Merge pull request #1482 from osodebailar/fix/plugin-preference-back-button
fix plugin preference back button
This commit is contained in:
commit
bb98586055
2 changed files with 12 additions and 2 deletions
|
@ -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">
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue