高亮显示系统设置中的菜单项

编程入门 行业动态 更新时间:2024-10-28 10:37:09
本文介绍了高亮显示系统设置中的菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

试图提出一个我没有在这里找到的问题-如何突出显示android设置应用程序菜单项?

Trying to bring up an unaswered question I found here - How to highlight android setting app menu item?

如该视频所示 www.youtube/watch?v= eHXBc5Mmsqs

"Power Shade"进入屏幕后,菜单项将突出显示.我正在尝试将相同功能添加到我的应用中,使用此突出显示功能将用户引导至设置菜单中的某个项目.我似乎找不到有关如何实际执行此操作的任何信息,也不知道它是否具有我可以搜索的特定名称.

The "Power Shade" menu item is being highlighted once you enter the screen. I am trying to add the same feature to my app, guiding users to an item in the settings menu using this highlight feature. I can't seem to find any information on how to actually implement this, nor do I know if it has a specific name I could search for.

任何帮助将不胜感激!

推荐答案

反编译应用程序后,以下是它的工作原理(简化):

After decompiling the app, here's how it works (simplified):

Intent intent = new Intent("com.samsung.accessibility.installed_service"); if (intent.resolveActivity(context.getPackageManager()) == null) { intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS); } final String EXTRA_FRAGMENT_ARG_KEY = ":settings:fragment_args_key"; final String EXTRA_SHOW_FRAGMENT_ARGUMENTS = ":settings:show_fragment_args"; Bundle bundle = new Bundle(); String showArgs = context.getPackageName() + "/" + MyService.class.getName(); bundle.putString(EXTRA_FRAGMENT_ARG_KEY, showArgs); intent.putExtra(EXTRA_FRAGMENT_ARG_KEY, showArgs); intent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, bundle); try { context.startActivity(intent); String toastText = "Find PowerShade here"; Toast.makeText(context, toastText, LENGTH_LONG).show(); } catch (Exception e) { // ask user to grant permission manually }

基本上它使用的是未公开的Android功能(请参见 SettingsActivity.java (在Android源代码中).

Basically it's using undocumented features of Android (see SettingsActivity.java in Android source).

更多推荐

高亮显示系统设置中的菜单项

本文发布于:2023-11-16 19:32:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607166.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单项   系统设置   中的菜   高亮

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!