Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
525 views
in Technique[技术] by (71.8m points)

Highlight the Menu Item found in Search Result of Android Settings App

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.

enter image description here

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) })
}

I referred to the Solution on this LINK

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...