Last active
February 15, 2018 13:17
-
-
Save sideffect0/97be006a8dd74fce45a93719686e6bfc to your computer and use it in GitHub Desktop.
Change App Icon at Runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pytenlabs.mailcastr.utils; | |
public class AppUtils{ | |
public static changeIconToPro(Context mContext){ | |
getPackageManager().setComponentEnabledSetting( | |
new ComponentName("com.pytenlabs.mailcastr", "com.pytenlabs.mailcastr.MainActivityPro"), | |
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); | |
try { | |
getPackageManager().setComponentEnabledSetting( | |
new ComponentName("com.pytenlabs.mailcastr", "com.pytenlabs.mailcastr.MainActivity"), | |
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); | |
} catch (Exception e) { | |
//oh oh | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment