Guest User

Untitled

a guest
Apr 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. PackageManager pm = getPackageManager();
  2. List<ApplicationInfo> apps = pm.getInstalledApplications(0);
  3.  
  4. List<ApplicationInfo> installedApps = new ArrayList<ApplicationInfo>();
  5.  
  6. for(ApplicationInfo app : apps) {
  7. if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {
  8. installedApps.add(app);
  9. } else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
  10. } else {
  11. installedApps.add(app);
  12. }
  13. }
  14.  
  15. if ("Remove".equals(n.getAttributes().item(0).getNodeValue())) {
  16. String removeAPK = n.getFirstChild().getNodeValue();
Add Comment
Please, Sign In to add comment