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:de.dknapps.pswgendroid.ServiceDetailFragment.java

@Override
public void onResume() {
    if (!PswGenAdapter.isServiceInfoListLoaded()) { // Zwischendurch SCREEN_OFF gewesen?
        showEmptyCurrentServiceInfo(); // Anzeigefelder des Dienstes lschen
        if (getActivity() instanceof ServiceDetailActivity) {
            // Wenn die aufrufende Activity keine ServiceDetailActivity ist, dann ist es
            // die ServiceListActivity und in dem Fall soll nur dort die Abfrage der
            // Passphrase erfolgen, damit das nicht zweimal (hier und dort) geschieht
            DialogFragment passphraseDialog = new PassphraseDialog();
            passphraseDialog.show(getActivity().getFragmentManager(), "passphrase_dialog");
        }//  w  w w. j a  v a2s  . c  om
    } else {
        loadAndShowCurrentServiceInfo(); // Dienst gem des bergebenen Arguments laden
    }
    super.onResume();
}

From source file:com.sbhstimetable.sbhs_timetable_android.TimetableActivity.java

@Override
public void onResume() {
    super.onResume();
    if (!PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PREF_DISABLE_DIALOG, false)) {
        DialogFragment f = new FeedbackDialogFragment();
        f.show(this.getFragmentManager(), "dialog");
    }// www.j  a  v  a2 s.  c o m
    NotificationService.startUpdatingNotification(this);
    this.mNavigationDrawerFragment.updateList();
    this.isActive = true;
}

From source file:de.uulm.graphicalpasswords.openpassgo.PassGoLoginActivity.java

public void submit(View view) {
    DialogFragment dialog;
    if (password.equals(patternView.getInput().toString())) {
        dialog = new ResultOKDialog();
    } else {/* w  w w  .j  a va2  s  .c  om*/
        dialog = new WrongResultDialog();
    }
    dialog.show(getFragmentManager(), "result");
}

From source file:at.alladin.rmbt.android.sync.RMBTSyncEnterCodeFragment.java

@Override
public void taskEnded(final JSONArray resultList) {

    overlay.setVisibility(View.GONE);
    overlay.setClickable(false);/*from  w w  w.  ja va2  s .c  om*/
    codeField.setClickable(true);
    syncButton.setOnClickListener(listener);

    if (resultList != null && resultList.length() > 0 && !syncTask.hasError())
        for (int i = 0; i < resultList.length(); i++) {

            codeField.clearFocus();
            syncButton.requestFocus();

            JSONObject resultListItem;
            try {
                resultListItem = resultList.getJSONObject(i);

                final String title = resultListItem.optString("msg_title");
                final String text = resultListItem.optString("msg_text");
                final boolean success = resultListItem.optBoolean("success");

                if (text.length() > 0) {
                    String popBackStackIncluding = null;
                    if (success) {
                        popBackStackIncluding = "sync";
                        ((RMBTMainActivity) getActivity()).setHistoryDirty(true);
                        ((RMBTMainActivity) getActivity()).setSettings(null, null);
                        ((RMBTMainActivity) getActivity()).checkSettings(true, null);
                    }

                    final DialogFragment newFragment = RMBTAlertDialogFragment.newInstance(title, text,
                            popBackStackIncluding);

                    newFragment.show(getActivity().getFragmentManager(), "sync_msg");
                }

            } catch (final JSONException e) {
                e.printStackTrace();
            }

        }
}

From source file:de.uulm.graphicalpasswords.opentapi.TAPICreatePasswordActivity.java

public void submit(View view) {
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor edit = sharedPref.edit();
    edit.putString("tapi_pw", arrayToString(input));
    edit.commit();//from w  ww . j  a  va  2 s.c  o  m

    Bundle bundle = new Bundle();
    bundle.putStringArray("input", input);
    DialogFragment dialog = new RememberPasswordDialogFragment();
    dialog.setArguments(bundle);
    dialog.show(getFragmentManager(), "remember");
}

From source file:mx.openpay.android.example.AddCardActivity.java

@Override
public void onError(final OpenpayServiceException error) {
    error.printStackTrace();/*from w w  w  . j a  va2  s. co  m*/
    this.progressFragment.dismiss();
    int desc = 0;
    String msg = null;
    switch (error.getErrorCode()) {
    case 3001:
        desc = R.string.declined;
        msg = this.getString(desc);
        break;
    case 3002:
        desc = R.string.expired;
        msg = this.getString(desc);
        break;
    case 3003:
        desc = R.string.insufficient_funds;
        msg = this.getString(desc);
        break;
    case 3004:
        desc = R.string.stolen_card;
        msg = this.getString(desc);
        break;
    case 3005:
        desc = R.string.suspected_fraud;
        msg = this.getString(desc);
        break;

    case 2002:
        desc = R.string.already_exists;
        msg = this.getString(desc);
        break;
    default:
        desc = R.string.error_creating_card;
        msg = error.getDescription();
    }

    DialogFragment fragment = MessageDialogFragment.newInstance(R.string.error, msg);
    fragment.show(this.getFragmentManager(), "Error");
}

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

/**
 * Generiert das Passwort und zeigt es an.
 * /*from  w  ww  .j a va 2  s.  c om*/
 * FIXME dkn Die callingActivity kann durch getActivity() ersetzt werden.
 */
public void onClickButtonDisplayPassword(final Activity callingActivity, final View buttonOpenUrl) {
    try {
        Bundle arguments = new Bundle();
        String password = getValidatedOrGeneratedPassword();
        String passwordExplanation = getPasswordExplanation(password);
        arguments.putString(PasswordDialog.ARG_PASSWORD, password);
        arguments.putString(PasswordDialog.ARG_PASSWORD_EXPLANATION, passwordExplanation);
        DialogFragment passwordDialog = new PasswordDialog();
        passwordDialog.setArguments(arguments);
        passwordDialog.show(getActivity().getFragmentManager(), "password_dialog");
    } catch (Exception e) {
        PswGenAdapter.handleThrowable(callingActivity, e);
    }
}

From source file:scmu.nutweet.bluetooth.BluetoothChat.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    Intent serverIntent;/* ww w.j  a va2  s .c o m*/
    switch (item.getItemId()) {
    case android.R.id.home:
        onBackPressed();
        return true;
    case R.id.secure_connect_scan:
        // Launch the DeviceListActivity to see devices and do scan
        serverIntent = new Intent(this, DeviceListActivity.class);
        startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE_SECURE);
        return true;
    case R.id.insecure_connect_scan:
        // Launch the DeviceListActivity to see devices and do scan
        serverIntent = new Intent(this, DeviceListActivity.class);
        startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE_INSECURE);
        return true;
    case R.id.discoverable:
        // Ensure this device is discoverable by others
        ensureDiscoverable();
        return true;
    case R.id.newtweet:
        FragmentManager fm = getFragmentManager();
        DialogFragment dialog = NewTweetFragment.newInstance();
        dialog.show(fm, "dialog");
        return true;
    }
    return false;
}

From source file:mx.openpay.android.example.AddCardActivity.java

@Override
public void onSuccess(final OperationResult result) {
    this.progressFragment.dismiss();
    this.clearData();
    DialogFragment fragment = MessageDialogFragment.newInstance(R.string.card_added,
            this.getString(R.string.card_created));
    fragment.show(this.getFragmentManager(), this.getString(R.string.info));
}

From source file:de.uulm.graphicalpasswords.openuyi.UYILoginActivity.java

@Override
public void onClick(View v) {
    vibrator.vibrate(25);//w  w w .  ja  v  a2 s . com
    clickedPictures[countClicks] = v.getId();
    countClicks++;
    if (countClicks == password_length) {
        Arrays.sort(clickedPictures);
        DialogFragment dialog;
        if (password.equals(Arrays.toString(clickedPictures))) {
            dialog = new ResultOKDialog();
        } else {
            dialog = new WrongResultDialog();
        }
        dialog.show(getFragmentManager(), "result");
    }
}