diff --git a/ExampleProvider/build.gradle.kts b/ExampleProvider/build.gradle.kts index 3270d2912f..777aa7c799 100644 --- a/ExampleProvider/build.gradle.kts +++ b/ExampleProvider/build.gradle.kts @@ -13,12 +13,12 @@ cloudstream { authors = listOf("Cloudburst", "Luna712") /** - * Status int as one of the following: - * 0: Down - * 1: Ok - * 2: Slow - * 3: Beta-only - **/ + * Status int as one of the following: + * 0: Down + * 1: Ok + * 2: Slow + * 3: Beta-only + */ status = 1 // Will be 3 if unspecified tvTypes = listOf("Movie") diff --git a/ExampleProvider/src/main/kotlin/com/example/ExamplePlugin.kt b/ExampleProvider/src/main/kotlin/com/example/ExamplePlugin.kt index 79fffa5ea3..c334c2a873 100644 --- a/ExampleProvider/src/main/kotlin/com/example/ExamplePlugin.kt +++ b/ExampleProvider/src/main/kotlin/com/example/ExamplePlugin.kt @@ -7,19 +7,14 @@ import com.lagradost.cloudstream3.plugins.Plugin @CloudstreamPlugin class ExamplePlugin: Plugin() { - private var activity: AppCompatActivity? = null - override fun load(context: Context) { - activity = context as? AppCompatActivity - // All providers should be added in this manner registerMainAPI(ExampleProvider()) - openSettings = { + openSettings = { ctx -> + val activity = ctx as AppCompatActivity val frag = BlankFragment(this) - activity?.let { - frag.show(it.supportFragmentManager, "Frag") - } + frag.show(activity.supportFragmentManager, "Frag") } } } \ No newline at end of file