Code example for List

Methods: get, isEmpty

0
  } 
 
  @Override 
  public ResolveInfo resolveActivity(Intent intent, int flags) {
    List<ResolveInfo> candidates = queryIntentActivities(intent, flags);
    return candidates.isEmpty() ? null : candidates.get(0);
  } 
 
  @Override 
  public ResolveInfo resolveService(Intent intent, int flags) {
    return resolveActivity(intent, flags);
  } 
 
  public void addResolveInfoForIntent(Intent intent, List<ResolveInfo> info) {
    resolveInfoForIntent.put(intent, info);
  } 
 
  public void addResolveInfoForIntent(Intent intent, ResolveInfo info) {
    List<ResolveInfo> infoList = findOrCreateInfoList(intent);
    infoList.add(info);
  }