android - Remove from launcher BUT keep enabled / startable -


i tried coding it, tried solving google , stackoverflow, nothing found :=) else has better idea, im not sure if right:

i have 2 applications: ad (main app) / adfree-pro (just license starts ad app without ads ;p)

so the problem is, want have pro version (with pro icon) in launcher, starts normal-ad app, (the normal ad-app) not in launcher.

i tried removing ad-app launcher (which due research should remove launcher)

pkgmgr.setcomponentenabledsetting(new componentname(package_name, package_name + ".main"), packagemanager.component_enabled_state_disabled, packagemanager.dont_kill_app);

which results to: icons in launcher correct ;) but application can't found on phone, launched, started, not launcher pro activity shortcut. seems there (shortcuts can created) crashes activity exception when try launch it.

02-18 14:38:59.237: error/androidruntime(9941): caused by: android.content.activitynotfoundexception: unable find explicit activity class {package_name/package_name.main}; have declared activity in androidmanifest.xml?

which doesnt seem belong (the error message) looks there has happened more application removed entry in launcher.

thanks lot guys, every workaround situation appreciated :) best regards :)

you can't have app installed , hide it's launcher icon. way i'm addressing application works similar yours don't try fight icons instead app can launched using ether icon. don't have in main (free) app , code launches app pro icon following:

/** called when activity first created. */ @override public void oncreate(bundle bundle) {     super.oncreate(bundle);     // check if main app installed. if yes start     if (appexists()) {         log.d(tag, "started main app pro");         intent intent = new intent(intent.action_view, uri.parse("myapp://com.myapp.main"));         startactivity(intent);         finish();     } else {         // display view link market          onappnotexists();     } } 

it's implement appexists() sort of license check

of course, alternatively can develop app's common code library project , distribute in 2 flavors without duplicating code


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -