Java: Need some way to shorten this code

If it’s the same syntax as C# and the flags are set properly, you could do this:

PackageManager p = context.getPackageManager(); 
final List<PackageInfo> appinstall = 
    p.getInstalledPackages(PackageManager.GET_PERMISSIONS | 
                                      PackageManager.GET_PROVIDERS)

Leave a Comment