查詢Intent

jackie_gnu發表於2011-09-08
          Intent shareIntent = new Intent(Intent.ACTION_SEND);
          String mimeType = "audio/mpeg";
          shareIntent.setType(mimeType);

          ResolveInfo resolveInfo;

          PackageManager pm = getPackageManager();

          List<ResolveInfo> shareActivityList = pm
                  .queryIntentActivities(shareIntent, PackageManager.MATCH_DEFAULT_ONLY);

          for (int i = 0; i < shareActivityList.size(); i++) {
              resolveInfo = shareActivityList.get(i);
                    Log.v(TAG,"--->" + resolveInfo.loadLabel(pm));
          }

相關文章