将BroadcastReceiver变成可观察的-Android开发

时间:2024-06-15 06:20:45
【文件属性】:

文件名称:将BroadcastReceiver变成可观察的-Android开发

文件大小:192KB

文件格式:ZIP

更新时间:2024-06-15 06:20:45

Android Kotlin

BroadcastReceiverObservable将BroadcastReceiver变成RxJava可观察的用法开始侦听连接更改事件:val text = findViewById (R.id.text)val context = applicati BroadcastReceiverObservable将BroadcastReceiver变成RxJava可观察的用法开始侦听连接变化事件:val文本= findViewById (R.id.text)val上下文= applicationContext val过滤器= IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)BroadcastReceiverObservable.create(context,filter).startWith(Intent()).map {val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE)as ConnectivityManager val


【文件预览】:
BroadcastReceiverObservable-master
----.gitignore(1KB)
----app()
--------.gitignore(7B)
--------build.gradle(1KB)
--------src()
--------proguard-rules.pro(751B)
----settings.gradle(47B)
----build.gradle(482B)
----.travis.yml(222B)
----gradlew(5KB)
----broadcastreceiverobservable()
--------.gitignore(7B)
--------build.gradle(746B)
--------src()
--------proguard-rules.pro(751B)
----LICENSE.txt(11KB)
----README.md(2KB)
----gradlew.bat(2KB)
----gradle.properties(801B)
----gradle()
--------wrapper()

网友评论