如何在安卓中打开用于选择 WiFi 的小弹出菜单?

huangapple go评论130阅读模式
英文:

How to open little popup menu for selecting wifi in android?

问题

我注意到一些安卓应用中出现了这种半屏的WiFi选择菜单。
我想在自己的应用中使用这个菜单,让用户有可能在不跳转到设置应用的情况下选择WiFi。
我没有找到任何关于如何实现这一点的指示。然而,Android Studio的布局检查器显示它属于系统,而不属于应用。
有人知道如何打开这个菜单吗?

英文:

I noticed this half screen wifi selection menu in some Android Apps.
如何在安卓中打开用于选择 WiFi 的小弹出菜单?

I would like to use this menu in my own app, to give the user the possibility to select the wifi without jumping to settings app.
I didn't find any instruction how to do this. However AndroidStudios Layout Inspector showed me that its belonging to the system, not to the app.
Anyone knows how to open this menu ?

答案1

得分: 2

这被称为设置面板:

链接:https://medium.com/google-developer-experts/exploring-android-q-settings-panels-d308525b8345

英文:

It's called a Settings Panel:

https://medium.com/google-developer-experts/exploring-android-q-settings-panels-d308525b8345

答案2

得分: 2

你正在寻找 Settings Panel

这适用于 Android Q。
以下是调用示例。

startActivityForResult(Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY), INTERNET_SETTINGS_REQUEST)
英文:

You are looking for Settings Panel

This is for Android Q.
Here's an example to how to call it.

startActivityForResult(Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY), INTERNET_SETTINGS_REQUEST)

huangapple
  • 本文由 发表于 2020年8月27日 17:39:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/63613229.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定