/** * Inflate the in-track view for the action of the given MIME-type. Will use the icon provided by * the {@link DataKind}. */ private View inflateAction(String mimeType) { final CheckableImageView view = (CheckableImageView) obtainView(); boolean isActionSet = false; // Add direct intent if single child, otherwise flag for multiple ActionList children = mActions.get(mimeType); Action firstInfo = children.get(0); if (children.size() == 1) { view.setTag(firstInfo); } else { for (Action action : children) { if (action.isPrimary()) { view.setTag(action); isActionSet = true; break; } } if (!isActionSet) { view.setTag(children); } } // Set icon and listen for clicks final CharSequence descrip = mResolveCache.getDescription(firstInfo); final Drawable icon = mResolveCache.getIcon(firstInfo); view.setChecked(false); view.setContentDescription(descrip); view.setImageDrawable(icon); view.setOnClickListener(this); return view; }