突出显示在 Android 设置应用程序的搜索结果中找到的菜单项 [英] Highlight the Menu Item found in Search Result of Android Settings App

查看:26
本文介绍了突出显示在 Android 设置应用程序的搜索结果中找到的菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android核心设置应用程序中,当我们在搜索栏中搜索任何内容时,该搜索的结果会自动突出显示.
例如请参见下图,我在通知访问"部分突出显示了我的应用程序名称.

Inside Android core Settings App, when we search anything in the search bar, then the result of that search is highlighted automatically.
For e.g. please see below image where I highlighted my application name in the Notification Access section.

我通过以下代码实现了这一点:

I achieved this by following code:

val intent = Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS").apply {
    val app = "${application.packageName}/${NotificationListener::class.java.name}" //Here NotificationListener is a service name
    val fragmentKey = ":settings:fragment_args_key"
    val showFragmentKey = ":settings:show_fragment_args"
    putExtra(fragmentKey, app)
    putExtra(showFragmentKey, Bundle().apply { putString(fragmentKey, app) })
}

我参考了这个 LINK

但是,我想在使用访问设置中突出显示我的应用程序名称.即当我打开 Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS) 的意图时,然后在应用列表中,我的应用名称必须突出显示.

However, I want to highlight my application name in the Usage Access Setting. i.e. when I open the intent for Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS) then inside the list of apps, my app name must be highlighted.

然而,上述逻辑/方法不适用于使用访问屏幕.
我的应用程序打开了意图,但没有在那里突出显示我的应用程序名称.
我做了详细的研究,但我仍然面临挑战.
因此,我请求大家帮忙.

However the above logic/approach is not working for Usage Access Screen.
My application opens the intent but does not highlight my app name there.
I did a detailed research but I am still facing challenge.
Hence, I request you all to please assist.

推荐答案

对于 ACTION_USAGE_ACCESS_SETTINGS ,我找不到.你在哪儿见过吗?如果是这样,请告诉我在哪个应用程序上.我已在此处提出要求:

For ACTION_USAGE_ACCESS_SETTINGS , I can't find one. Have you seen it anywhere? If so, please show me on which app. I've requested about this here:

一般来说,对于所有设置:

And one in general, for all settings:

至于通知访问,请查看此处:stackoverflow.com/a/63914445/878126

As for notification-access, check here: stackoverflow.com/a/63914445/878126

这篇关于突出显示在 Android 设置应用程序的搜索结果中找到的菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆