Skip to content

Commit

Permalink
Removed warning
Browse files Browse the repository at this point in the history
  • Loading branch information
DHuckaby committed Oct 1, 2024
1 parent 5d65ff9 commit f2255b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/learnings/2024-08-25-dynamic-app-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ hide:

Have you ever wanted to swap your Android app's icon at runtime? It could be useful as a premium feature or as a way for your users to customize the feel of your application. I have a solution that works for the most part, with some drawbacks that will need to be weighed before implementing it into your application.

Starting off this is the exact same method seen in applications such as Discord or Todoist. The main drawback is that the first time we enable this new behavior your application will be closed automatically as your new icon is applied. Subsequent calls to reset or switch to any other icons will not result in your application closing. This is undefined behavior, and I have no workaround for it. If that is fine, let's get into the weeds.
Starting off this is the exact same method seen in applications such as Discord or Todoist. The main drawback is that the first time we enable this new behavior your application will be closed automatically as your new icon is applied. Subsequent calls to reset or switch to any other icons will not result in your application closing. This is undefined behavior, and I have no workaround for it.

### Activity alias
Traditionally I have only ever used an [activity-alias](https://developer.android.com/guide/topics/manifest/activity-alias-element) to redirect my launching activity reference when I have moved the actual class into a new package. We are going to be leveraging that concept to not only redirect once to our launching activity, but many times depending on how many icons you want. The catch is that by default only one of those should be enabled. That way you can at runtime switch between them by enabling and disabling aliases, resulting in the perception of the icon changing to the user.
Expand Down

0 comments on commit f2255b7

Please sign in to comment.