Issue
Is it possible to change Android application window title/label and its icon without a change of launcher icon and application name shown on application shortcut?
I mean the icons and window names as shown on the screenshot above. I am not referring to ActionBar (if exist), which is a part of layout.
Is it possible to change this dynamically by code? Is it possible to change it for each activity separately?
Solution
Lollipop added the TaskDescription
class: https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.html
In any activity, you can write something like this:
ActivityManager.TaskDescription description =
new ActivityManager.TaskDescription("test", null, 0xff0000ff);
setTaskDescription(description);
Some notes:
- The title you pass will continue to show in the "recents" view, even if you navigate to another activity deeper in the hierarchy
- Passing
null
for the icon will leave the default icon in place. - The color only applies to the current activity
Answered By - Ben P.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.