Wednesday, March 26, 2014

How to Get entrance ACTIVITY class applications


What method to use to get to class ACTIVITY other programs? Dynamic access to, for example, own a desktop software, click on the appropriate icon to enter the program, let alone use the shortcut ...... unless you can add a shortcut to an interface of an application is the same as the link below ...... The problem ...... http://bbs.csdn.net/topics/390612547
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
public static PackageInfo getPackageInfo (Context context) {
String packageName = context.getPackageName ();
try {
PackageInfo packageInfo = context.getPackageManager ()
. GetPackageInfo (
packageName,
PackageManager.GET_CONFIGURATIONS
| PackageManager.GET_ACTIVITIES);
return packageInfo;
} Catch (NameNotFoundException e) {
e.printStackTrace ();
return null;
}
}
Get all the packages ACTIVITIES.


PackageManager pm = context.getPackageManager ();
List LIST = pm
. GetInstalledApplications (PackageManager.GET_UNINSTALLED_PACKAGES);
for (ApplicationInfo _info: LIST) {
if (_info.packageName.indexOf ("mobileqq") <= 0) {
return true;
}
}

No comments:

Post a Comment