Example usage for android.support.v4.app DialogFragment setArguments

List of usage examples for android.support.v4.app DialogFragment setArguments

Introduction

In this page you can find the example usage for android.support.v4.app DialogFragment setArguments.

Prototype

public void setArguments(Bundle args) 

Source Link

Document

Supply the construction arguments for this fragment.

Usage

From source file:de.schildbach.wallet.ui.EncryptKeysDialogFragment.java

public static void show(boolean cancelable, final FragmentManager fm) {
    final DialogFragment newFragment = new EncryptKeysDialogFragment();

    final Bundle args = new Bundle();
    args.putBoolean(ONBOARDING_ARG, true);
    args.putBoolean(CANCELABLE_ARG, cancelable);
    newFragment.setArguments(args);

    newFragment.show(fm, FRAGMENT_TAG);//from   ww  w . jav a  2 s .com
}

From source file:com.example.nitish.welcomapp.activitypt.ElementDetailsFragment.java

/**
 * Create a new instance of this Fragment.
 *
 * @param atomicNumber The atomic number of the element to display
 * @return An instance of this Fragment// w  w w.  ja  v a 2  s . c  o m
 */
@NonNull
public static DialogFragment getInstance(int atomicNumber) {
    final DialogFragment fragment = new ElementDetailsFragment();

    final Bundle args = new Bundle();
    args.putInt(ARG_ATOMIC_NUMBER, atomicNumber);
    fragment.setArguments(args);

    return fragment;
}

From source file:com.example.nitish.welcomapp.activitypt.ElementDetailsFragment.java

/**
 * Create a new instance of this Fragment.
 *
 * @param atomicSymbol The atomic symbol of the element to display
 * @return An instance of this Fragment/*from   w  w  w .j a  v  a2  s .  c om*/
 */
@NonNull
public static DialogFragment getInstance(@NonNull String atomicSymbol) {
    final DialogFragment fragment = new ElementDetailsFragment();

    final Bundle args = new Bundle();
    args.putString(ARG_ATOMIC_SYMBOL, atomicSymbol);
    fragment.setArguments(args);

    return fragment;
}

From source file:com.vuze.android.remote.RemoteUtils.java

public static void editProfile(RemoteProfile remoteProfile, FragmentManager fm) {
    DialogFragment dlg;

    int remoteType = remoteProfile.getRemoteType();
    switch (remoteType) {
    case RemoteProfile.TYPE_CORE:
        dlg = new DialogFragmentVuzeCoreProfile();
        break;/*from   w  w w .  j  ava2s  .  c  om*/
    case RemoteProfile.TYPE_LOOKUP:
        dlg = new DialogFragmentVuzeRemoteProfile();
        break;
    default:
        dlg = new DialogFragmentGenericRemoteProfile();
        break;
    }
    Bundle args = new Bundle();
    Map<?, ?> profileAsMap = remoteProfile.getAsMap(false);
    String profileAsJSON = JSONUtils.encodeToJSON(profileAsMap);
    args.putSerializable("remote.json", profileAsJSON);
    dlg.setArguments(args);
    AndroidUtils.showDialog(dlg, fm, "GenericRemoteProfile");
}

From source file:com.ultramegasoft.flavordex2.dialog.ExportDialog.java

/**
 * Show the dialog.// w w  w  .j  a  va 2 s . c  om
 *
 * @param fm       The FragmentManager to use
 * @param entryIds The list of entry IDs to export
 */
public static void showDialog(@NonNull FragmentManager fm, @NonNull long[] entryIds) {
    final DialogFragment fragment = new ExportDialog();

    final Bundle args = new Bundle();
    args.putLongArray(ARG_ENTRY_IDS, entryIds);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:com.ultramegasoft.flavordex2.dialog.FileImportDialog.java

/**
 * Show the dialog./*  ww  w .  j  av a2s. co m*/
 *
 * @param fm       The FragmentManager to use
 * @param filePath The path to the selected file
 */
public static void showDialog(@NonNull FragmentManager fm, @NonNull String filePath) {
    final DialogFragment fragment = new FileImportDialog();

    final Bundle args = new Bundle();
    args.putString(ARG_FILE_PATH, filePath);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:com.ultramegasoft.flavordex2.dialog.FileSelectorDialog.java

/**
 * @param fm               The FragmentManager to use
 * @param target           The Fragment to send results to
 * @param requestCode      The request code
 * @param rootPath         The initial starting path
 * @param allowDirectories Whether to allow directories to be selected
 * @param nameFilter       Filter out files that do not contain any of these string
 * @param path             The current path
 *///from   www .  j  ava2  s .  co  m
private static void showDialog(@NonNull FragmentManager fm, @Nullable Fragment target, int requestCode,
        @Nullable String rootPath, boolean allowDirectories, @Nullable String[] nameFilter,
        @Nullable String path) {
    final DialogFragment fragment = new FileSelectorDialog();
    fragment.setTargetFragment(target, requestCode);

    final Bundle args = new Bundle();
    args.putString(ARG_ROOT_PATH, rootPath);
    args.putString(ARG_PATH, path);
    args.putBoolean(ARG_ALLOW_DIRECTORIES, allowDirectories);
    args.putStringArray(ARG_NAME_FILTER, nameFilter);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:at.bitfire.davdroid.syncadapter.EnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    String host_path = editBaseURL.getText().toString();
    args.putString(QueryServerDialogFragment.EXTRA_BASE_URL, URIUtils.sanitize(protocol + host_path));
    args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, editUserName.getText().toString());
    args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
    args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, checkboxPreemptive.isChecked());

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:com.dycody.android.idealnote.utils.date.ReminderPickers.java

/**
 * Shows fallback date and time pickers for smaller screens
 *//*ww  w.ja  v a  2  s .  c om*/

public void showDatePickerDialog(long presetDateTime) {
    Bundle b = new Bundle();
    b.putLong(DatePickerDialogFragment.DEFAULT_DATE, presetDateTime);
    DialogFragment picker = new DatePickerDialogFragment();
    picker.setArguments(b);
    picker.show(mActivity.getSupportFragmentManager(), Constants.TAG);
}

From source file:eu.trentorise.smartcampus.eb.fragments.CollectionsListFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.collection_add:
        DialogFragment newCollFragment = new NewCollectionDialogFragment();
        newCollFragment.setArguments(NewCollectionDialogFragment.prepare(null));
        newCollFragment.show(getActivity().getSupportFragmentManager(), "exp_coll");
        return true;
    default://from  w  w w. j  a  v a  2  s.c  om
        return super.onOptionsItemSelected(item);
    }
}