Example usage for android.app DialogFragment show

List of usage examples for android.app DialogFragment show

Introduction

In this page you can find the example usage for android.app DialogFragment show.

Prototype

public int show(FragmentTransaction transaction, String tag) 

Source Link

Document

Display the dialog, adding the fragment using an existing transaction and then committing the transaction.

Usage

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

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.next:
        FragmentTransaction ft = getFragmentManager().beginTransaction();

        Bundle args = new Bundle();
        try {/* w ww  .j  av  a2s .  c  o m*/
            args.putString(QueryServerDialogFragment.EXTRA_BASE_URI, getBaseURI().toString());
        } catch (URISyntaxException e) {
        }
        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());
        break;
    default:
        return false;
    }
    return true;
}

From source file:de.dknapps.pswgendroid.ServiceListFragment.java

@Override
public void onResume() {
    if (!PswGenAdapter.isServiceInfoListLoaded()) { // Zwischendurch SCREEN_OFF gewesen?
        setUpListAdapter(new ArrayList<ServiceInfo>()); // die Liste darf nicht mehr gezeigt werden
        DialogFragment passphraseDialog = new PassphraseDialog();
        passphraseDialog.show(getActivity().getFragmentManager(), "passphrase_dialog");
    }//from w w  w .ja va  2  s  .c o m
    super.onResume();
}

From source file:org.exfio.csyncdroid.syncadapter.LegacyV5EnterCredentialsFragment.java

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

    Bundle args = new Bundle();

    args.putString(android.accounts.AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE_LEGACYV5);
    args.putString(LegacyV5AccountSettings.KEY_BASE_URL,
            URIUtils.sanitize(protocol + editBaseURL.getText().toString()));
    args.putString(LegacyV5AccountSettings.KEY_USERNAME, editUserName.getText().toString());
    args.putString(LegacyV5AccountSettings.KEY_PASSWORD, editPassword.getText().toString());
    args.putString(LegacyV5AccountSettings.KEY_SYNCKEY, editSyncKey.getText().toString());
    args.putBoolean(LegacyV5AccountSettings.KEY_AUTH_PREEMPTIVE, true);

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);/*ww w .  java  2s  .  c o m*/
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:townley.stuart.app.android.trekkinly.Notification_picker_class.java

public void showTimePickerDialog(View v) {
    DialogFragment newFragment = new TimePickerFragment();
    newFragment.show(getActivity().getFragmentManager(), "timePicker");
}

From source file:townley.stuart.app.android.trekkinly.Notification_picker_class.java

public void showDatePickerDialog(View v) {
    DialogFragment newFragment = new DatePickerFragment();
    newFragment.show(getActivity().getFragmentManager(), "datePicker");
}

From source file:com.andreykaraman.multinote.ui.list.AltNoteActivity.java

void showAboutDialog() {

    FragmentTransaction ft = getFragmentManager().beginTransaction();
    Fragment prev = getFragmentManager().findFragmentByTag("aboutDialog");
    if (prev != null) {
        ft.remove(prev);/*from   ww w .  ja  v a 2 s  .co m*/
    }
    ft.addToBackStack(null);
    // Create and show the dialog.
    DialogFragment newFragment = AboutDialogFragment.newInstance();
    newFragment.show(ft, "aboutDialog");
}

From source file:org.exfio.weavedroid.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.putString(QueryServerDialogFragment.EXTRA_SYNC_KEY, editSyncKey.getText().toString());
    args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, true);

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);//  w  ww. j ava2 s.  co  m
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:com.bangz.smartmute.RulelistActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    } else if (id == R.id.action_add) {
        //TODO process action add new rule

        DialogFragment chooseRuleTypeDialog = new ChooseRuleTypeDialogFragment();
        chooseRuleTypeDialog.show(getFragmentManager(), "ChooseRuleTypeDialog");
        LogUtils.LOGD(TAG, "Dialog showed.");

        //Intent intent = new Intent(this, WifiEditActivity.class);
        //intent.putExtra(Constants.INTENT_EDITORNEW, Constants.INTENT_NEW);
        //startActivity(intent);
    }/*w  w  w .j ava  2s.  com*/
    return super.onOptionsItemSelected(item);
}

From source file:com.bodeme.easycloud.syncadapter.EnterCredentialsFragment.java

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

    Bundle args = new Bundle();

    String url;/*from  w w w.  ja va  2 s.com*/
    String username = editUserName.getText().toString();
    if (Constants.OWNCLOUD_URL == null) {
        url = editURL.getText().toString();
    } else {
        url = Constants.OWNCLOUD_URL;
    }

    if (url.charAt(url.length() - 1) != '/') {
        url = url + "/";
    }

    if (0 == typePosition) {
        url += "remote.php/caldav/principals/" + username + "/";
    } else {
        url += "remote.php/carddav/addressbooks/" + username + "/";
    }

    args.putString(QueryServerDialogFragment.EXTRA_BASE_URL, URIUtils.sanitize(url));
    args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, username);
    args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
    args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, true);

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

From source file:com.droid080419.droid080419.elevenfifty_nine.AltAddTaskActivity.java

public void startTimeDialog(View view) { //opens a dialog fragment to input start time
    CalendarGlobals.alt = this;
    CalendarGlobals.isStartTime = true;//from   w ww .j  a  v a2  s  .  c  o m
    DialogFragment newFrag = new TimePickerFragment();
    newFrag.show(getFragmentManager(), "timePicker");
}