我想知道如何在 Flipper Shared Preferences Viewer Plugin 中显示多个共享首选项键。KEY_FOO
, KEY_BAR
,KEY_BAZ
是共享首选项文件的字符串常量。
就像是
class App: Application() {
override fun onCreate() {
super.onCreate()
setupFlipper()
}
private fun setupFlipper() {
if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(this)) {
val client = AndroidFlipperClient.getInstance(this)
client.addPlugin(InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()))
client.addPlugin(
SharedPreferencesFlipperPlugin(applicationContext, KEY_FOO)
)
client.addPlugin(
SharedPreferencesFlipperPlugin(applicationContext, KEY_BAR)
)
client.addPlugin(
SharedPreferencesFlipperPlugin(applicationContext, KEY_BAZ)
)
client.start()
}
}
}