public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); doImport(mContext, mResId, mAccountList.get(which), mSubscriptionId); } }
public static void doImport(Context context, int resId, AccountWithDataSet account, int subscriptionId) { if (resId == R.string.import_from_sim) { doImportFromSim(context, account, subscriptionId); } else if (resId == R.string.import_from_vcf_file) { doImportFromVcfFile(context, account); } }
public static Dialog getSelectAccountDialog(Context context, int resId) { return getSelectAccountDialog(context, resId, null, null); }
/** * Called when an account is selected on {@link SelectAccountDialogFragment}. */ @Override public void onAccountChosen(AccountWithDataSet account, Bundle extraArgs) { AccountSelectionUtil.doImport(getActivity(), extraArgs.getInt(KEY_RES_ID), account, extraArgs.getInt(KEY_SUBSCRIPTION_ID)); // At this point the dialog is still showing (which is why we can use getActivity() above) // So close it. dismiss(); }
public static Dialog getSelectAccountDialog(Context context, int resId, DialogInterface.OnClickListener onClickListener) { return getSelectAccountDialog(context, resId, onClickListener, null); }
AccountSelectionUtil.doImport(getActivity(), resId, (size == 1 ? accountList.get(0) : null), (CompatUtils.isMSIMCompatible() ? subscriptionId : -1));
@Override protected Dialog onCreateDialog(int resId, Bundle bundle) { if (resId == R.string.import_from_vcf_file) { if (mAccountSelectionListener == null) { throw new NullPointerException( "mAccountSelectionListener must not be null."); } return AccountSelectionUtil.getSelectAccountDialog(this, resId, mAccountSelectionListener, new CancelListener()); } return super.onCreateDialog(resId, bundle); } }