今天看啥
    热点:

      天发国际娱乐官网:在发展战略上,必须“制度创新、双向开放、共享发展”,创造一个全新的平台。

      F-droid源码片段(一)


      protected boolean update() {

      long startTime = System.currentTimeMillis();

      compareCacheToPackageManager();
      updateCache();

      long duration = System.currentTimeMillis() - startTime;
      Log.d(TAG, "Took " + duration + "ms to compare the installed app cache with PackageManager.");

      return hasChanged();
      }

      比对系统的已安装的应用,查询需要插入和删除的应用列表

      private void compareCacheToPackageManager() {

      Map cachedInfo = InstalledAppProvider.Helper.all(context);

      List installedPackages = context.getPackageManager().getInstalledPackages(0);
      for (PackageInfo appInfo : installedPackages) {
      toInsert.add(appInfo);
      if (cachedInfo.containsKey(appInfo.packageName)) {
      cachedInfo.remove(appInfo.packageName);
      }
      }

      if (cachedInfo.size() > 0) {
      for (Map.Entry entry : cachedInfo.entrySet() ) {
      toDelete.add(entry.getKey());
      }
      }
      }

      www.1click-soft.comtruehttp://www.1click-soft.com/Javabc/880392.htmlTechArticleF-droid源码片段(一) protected boolean update() { long startTime = System.currentTimeMillis(); compareCacheToPackageManager(); updateCache(); long duration = System.current...

      相关文章

      相关搜索: 源码 片段

      帮客评论

      视觉看点
      百度 360 搜狗