inject context

This commit is contained in:
Milos Kozak 2021-11-10 09:15:05 +01:00
parent 43287f6dca
commit 081e8bd684

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.configBuilder
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
@ -39,6 +40,7 @@ class ConfigBuilderFragment : DaggerFragment() {
@Inject lateinit var protectionCheck: ProtectionCheck
@Inject lateinit var config: Config
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var ctx: Context
private var disposable: CompositeDisposable = CompositeDisposable()
private val pluginViewHolders = ArrayList<PluginViewHolder>()
@ -170,7 +172,7 @@ class ConfigBuilderFragment : DaggerFragment() {
pluginPreferences.setOnClickListener {
fragment.activity?.let { activity ->
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.PREFERENCES, {
val i = Intent(fragment.context, PreferencesActivity::class.java)
val i = Intent(ctx, PreferencesActivity::class.java)
i.putExtra("id", plugin.preferencesId)
fragment.startActivity(i)
}, null)