/** * Show the call subject dialog given a phone number to dial (e.g. from the dialpad). * * @param activity The activity. * @param number The number to dial. */ public static void start(Activity activity, String number) { start(activity, -1 /* photoId */, null /* photoUri */, null /* contactUri */, number /* nameOrNumber */, false /* isBusiness */, number /* number */, null /* displayNumber */, null /* numberLabel */, null /* phoneAccountHandle */); }
/** * Creates a call subject dialog. * * @param activity The current activity. * @param photoId The photo ID (used to populate contact photo). * @param photoUri The photo Uri (used to populate contact photo). * @param contactUri The Contact URI (used so quick contact can be invoked from contact photo). * @param nameOrNumber The name or number of the callee. * @param isBusiness {@code true} if a business is being called (used for contact photo). * @param number The raw number to dial. * @param displayNumber The number to dial, formatted for display. * @param numberLabel The label for the number (if from a contact). * @param phoneAccountHandle The phone account handle. */ public static void start(Activity activity, long photoId, Uri photoUri, Uri contactUri, String nameOrNumber, boolean isBusiness, String number, String displayNumber, String numberLabel, PhoneAccountHandle phoneAccountHandle) { Bundle arguments = new Bundle(); arguments.putLong(ARG_PHOTO_ID, photoId); arguments.putParcelable(ARG_PHOTO_URI, photoUri); arguments.putParcelable(ARG_CONTACT_URI, contactUri); arguments.putString(ARG_NAME_OR_NUMBER, nameOrNumber); arguments.putBoolean(ARG_IS_BUSINESS, isBusiness); arguments.putString(ARG_NUMBER, number); arguments.putString(ARG_DISPLAY_NUMBER, displayNumber); arguments.putString(ARG_NUMBER_LABEL, numberLabel); arguments.putParcelable(ARG_PHONE_ACCOUNT_HANDLE, phoneAccountHandle); start(activity, arguments); }
@Override public void onClick(View view) { if (view.getId() == R.id.primary_action_button && !TextUtils.isEmpty(voicemailUri)) { mVoicemailPrimaryActionButtonClicked = true; mExpandCollapseListener.onClick(primaryActionView); } else if (view.getId() == R.id.call_with_note_action) { CallSubjectDialog.start( (Activity) mContext, info.photoId, info.photoUri, info.lookupUri, (String) nameOrNumber /* top line of contact view in call subject dialog */, isBusiness, number, TextUtils.isEmpty(info.name) ? null : displayNumber, /* second line of contact view in dialog. */ numberType, /* phone number type (e.g. mobile) in second line of contact view */ accountHandle); } else { final IntentProvider intentProvider = (IntentProvider) view.getTag(); if (intentProvider != null) { final Intent intent = intentProvider.getIntent(mContext); // See IntentProvider.getCallDetailIntentProvider() for why this may be null. if (intent != null) { DialerUtils.startActivityWithErrorToast(mContext, intent); } } } }
@Override public boolean onMenuItemClick(MenuItem item) { int resId = item.getItemId(); if (resId == R.id.menu_2s_pause) { updateDialString(PAUSE); return true; } else if (resId == R.id.menu_add_wait) { updateDialString(WAIT); return true; } else if (resId == R.id.menu_call_with_note) { CallSubjectDialog.start(getActivity(), mDigits.getText().toString()); hideAndClearDialpad(false); return true; } else { return false; } }