Skip to content

Instantly share code, notes, and snippets.

@chrislacy
Last active April 23, 2018 13:57
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislacy/5646240 to your computer and use it in GitHub Desktop.
Save chrislacy/5646240 to your computer and use it in GitHub Desktop.
Icon pack makers wanting to implement 'apply icon pack' functionality for Action Launcher should just include this snippet as appropriate.
Button actionLauncherButton = (Button) findViewById(R.id.action_launcher_button);
actionLauncherButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Check Action Launcher is installed
Intent intent = getPackageManager().getLaunchIntentForPackage("com.actionlauncher.playstore");
if (intent != null) {
// TODO BY YOU: set this package name as appropriate. Eg "kov.theme.stark"
String yourPackageName = ;
intent.putExtra("apply_icon_pack",yourPackageName);
startActivity(intent); // Action Launcher will take it from here...
} else {
// Direct users to get Action Launcher Pro
String playStoreUrl = "https://play.google.com/store/apps/details?id=com.actionlauncher.playstore";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreUrl)));
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment