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

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

Introduction

In this page you can find the example usage for android.support.v4.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:com.pileproject.drive.setting.app.CopyrightNoticePreference.java

@Override
public void startDialog(PreferenceFragmentCompat parent) {
    if (parent.getChildFragmentManager().findFragmentByTag(FRAGMENT_TAG) != null) {
        return;/*from   w  ww. j av a  2  s . c o m*/
    }

    DialogFragment f = new CopyrightNoticeFragment();
    f.setTargetFragment(parent, 0);

    // not 'getFragmentManager' because we are creating
    // a nested DialogFragment
    f.show(parent.getChildFragmentManager(), FRAGMENT_TAG);
}

From source file:com.pileproject.drive.setting.machine.NxtPortConnectionPreference.java

@Override
public void startDialog(PreferenceFragmentCompat parent) {
    if (parent.getChildFragmentManager().findFragmentByTag(FRAGMENT_TAG) != null) {
        return;//from  w  w  w .ja  v  a 2 s  .  c  om
    }

    DialogFragment f = new NxtPortConnectionFragment();
    f.setTargetFragment(parent, 0);

    // not 'getFragmentManager' because we are creating
    // a nested DialogFragment
    f.show(parent.getChildFragmentManager(), FRAGMENT_TAG);
}

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

/**
 * Shows fallback date and time pickers for smaller screens
 *//* w w w. ja  v  a  2s.  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:de.incoherent.osaac.activities.MainActivity.java

private void newAlarm() {
    DialogFragment newFragment = new TimeSelectionDialog(this);
    newFragment.show(getSupportFragmentManager(), "timePicker");
}

From source file:de.stadtrallye.rallyesoft.fragments.AssistantCompleteFragment.java

private void showFailure(Exception e, int status) {
    prg_status.setVisibility(View.GONE);
    if (Util.isHttpPasswordIncorrect(status)) {
        text_status.setText(R.string.password_incorrect_try_again);
        DialogFragment dialog = new AssistantPasswordDialogFragment();
        dialog.show(getChildFragmentManager(), AssistantPasswordDialogFragment.TAG);
    } else {/*  w  w w .  jav  a  2s .c o m*/
        text_status.setText(R.string.connection_failure);
    }
}

From source file:com.pileproject.drive.setting.machine.BluetoothMachineSelectPreference.java

@Override
public void startDialog(PreferenceFragmentCompat parent) {
    if (parent.getChildFragmentManager().findFragmentByTag(FRAGMENT_TAG) != null) {
        return;//  ww  w  .  j  av a 2s  .c  om
    }

    DialogFragment f = new BluetoothMachineSelectFragment();
    f.setTargetFragment(parent, 0);

    // not 'getFragmentManager' because we are creating
    // a nested DialogFragment
    f.show(parent.getChildFragmentManager(), FRAGMENT_TAG);
}

From source file:com.handpoint.headstart.client.ui.LoginActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    HeadstartService.removeProperty("last_activity");
    mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    long elapsedTime = SystemClock.elapsedRealtime();
    long lastAttempt = getLastAttempt();
    if (elapsedTime > lastAttempt && lastAttempt > 0 && lastAttempt + ATTEMPT_DELAY > elapsedTime) {
        long timeToWait = ATTEMPT_DELAY - (elapsedTime - lastAttempt);
        Toast.makeText(this, getString(R.string.warn_wait_message, formatTime(timeToWait)), Toast.LENGTH_LONG)
                .show();//from   ww  w.  j  av a 2s  . c om
        finish();
        return;
    }
    setLastAttempt(0);
    setContentView(R.layout.login);

    Button loginButton = (Button) findViewById(R.id.login_button);
    loginButton.setOnClickListener(this);

    TextView forgotLink = (TextView) findViewById(R.id.forgot_password_link);
    SpannableString content = new SpannableString(getString(R.string.forgot_password_link_label));
    content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
    forgotLink.setText(content);
    forgotLink.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            DialogFragment newFragment = new ForgotPasscodeDialog();
            newFragment.show(getSupportFragmentManager(), "forgot_passcode");
        }
    });
}

From source file:com.actionbarsherlock.sample.demos.app.FragmentDialogSupport.java

void showDialog() {
    mStackLevel++;//w  w w .j  a v a2 s .com

    // DialogFragment.show() will take care of adding the fragment
    // in a transaction.  We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog");
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);

    // Create and show the dialog.
    DialogFragment newFragment = MyDialogFragment.newInstance(mStackLevel);
    newFragment.show(ft, "dialog");
}

From source file:io.upnext.beaconcontrol.app.LoginActivity.java

private void showLoginErrorDialog() {
    DialogFragment dialogFragment = LoginErrorDialogFragment.newInstance();
    dialogFragment.show(getSupportFragmentManager(), LOGIN_ERROR_DIALOG_TAG);
}

From source file:com.eyebrowssoftware.bptrackerfree.activity.BPDataManager.java

@SuppressLint("CommitTransaction")
void showDeleteConfirmationDialog() {
    // DialogFragment.show() will take care of adding the fragment
    // in a transaction.  We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(DELETE);
    if (prev != null) {
        ft.remove(prev);//from ww  w. j av  a  2  s .com
    }
    ft.addToBackStack(DELETE);

    // Create and show the dialog.
    DialogFragment newFragment = AlertDialogFragment.getNewInstance(R.string.label_delete_history,
            R.string.msg_delete, R.string.label_yes, R.string.label_no);
    newFragment.show(ft, DELETE);
}