当前位置: 首页>>代码示例>>Java>>正文


Java DialogFragment.setTargetFragment方法代码示例

本文整理汇总了Java中android.support.v4.app.DialogFragment.setTargetFragment方法的典型用法代码示例。如果您正苦于以下问题:Java DialogFragment.setTargetFragment方法的具体用法?Java DialogFragment.setTargetFragment怎么用?Java DialogFragment.setTargetFragment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.app.DialogFragment的用法示例。


在下文中一共展示了DialogFragment.setTargetFragment方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showMarkEpisodeDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private synchronized void showMarkEpisodeDialog(int type) {
    if (mAnime == null)
        return;
    final FragmentManager fm = getFragmentManager();
    if (fm == null)
        return;
    // Create the fragment and show it as a dialog.
    dismissDialog();
    DialogFragment newFragment = new MarkEpisodeDialog();
    newFragment.setTargetFragment(this, 0);
    Bundle bundle = new Bundle();
    bundle.putInt("type", type);
    bundle.putInt("itype", InputType.TYPE_CLASS_NUMBER);
    bundle.putInt("itype2", InputType.TYPE_CLASS_NUMBER);
    bundle.putInt("min", 0);
    bundle.putInt("max", mAnime.getEpisodes().size());
    newFragment.setArguments(bundle);
    newFragment.show(fm,
            "mcdfragment");
}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:21,代码来源:AnimeMaterialListFragment.java

示例2: onOptionsItemSelected

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_locate:
            if (hasLocationPermission()) {
                findCoords();
            } else if (ActivityCompat.shouldShowRequestPermissionRationale(
                    getActivity(), LOCATION_PERMISSIONS[0])) {
                DialogFragment dialog = new PermissionRationaleFragment();
                dialog.setTargetFragment(PlaceListFragment.this, 0);
                dialog.show(getFragmentManager(), PERMISSION_RATIONALE_DIALOG);

            } else {
                requestPermissions(LOCATION_PERMISSIONS, REQUEST_LOCATION_PERMISSIONS);
            }
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:plweegie,项目名称:piast-trail,代码行数:21,代码来源:PlaceListFragment.java

示例3: onDisplayPreferenceDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (callback != null) {
        callback.onSettingChanged();
    }

    DialogFragment dialogFragment = null;
    if (preference instanceof StylePreference) {
        dialogFragment
                = StylePreferenceDialogFragment
                .newInstance(preference);
    } else if (preference instanceof ColumnCountPreference) {
        dialogFragment
                = ColumnCountPreferenceDialogFragment
                .newInstance(preference);
    }

    if (dialogFragment != null) {
        dialogFragment.setTargetFragment(this, 0);
        dialogFragment.show(this.getFragmentManager(), DIALOG_FRAGMENT_TAG);
        return;
    }

    super.onDisplayPreferenceDialog(preference);
}
 
开发者ID:kollerlukas,项目名称:Camera-Roll-Android-App,代码行数:26,代码来源:SettingsActivity.java

示例4: onDisplayPreferenceDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
/**
 * Called when a preference in the tree requests to display a dialog. Subclasses should
 * override this method to display custom dialogs or to handle dialogs for custom preference
 * classes.
 *
 * @param preference The Preference object requesting the dialog.
 */
@Override
public void onDisplayPreferenceDialog(Preference preference) {
	if (preference instanceof VolumePreference) {
		DialogFragment fragment = VolumePreferenceFragment.newInstance(preference);
		fragment.setTargetFragment(this, 0);
		fragment.show(getFragmentManager(),
				"android.support.v7.preference.PreferenceFragment.DIALOG");
	} else {
		super.onDisplayPreferenceDialog(preference);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:SettingsFragment.java

示例5: onDisplayPreferenceDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onDisplayPreferenceDialog(Preference preference) {
    DialogFragment fragment;
    if (preference instanceof DataListPreference) {
        fragment = DataListPreferenceDialogFragmentCompat.newInstance(preference);
        fragment.setTargetFragment(this, 0);
        fragment.show(getFragmentManager(),
                "android.support.v7.preference.PreferenceFragment.DIALOG");
    } else super.onDisplayPreferenceDialog(preference);
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:11,代码来源:SettingsFragment.java

示例6: onPreferenceDisplayDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public boolean onPreferenceDisplayDialog(PreferenceFragmentCompat preferenceFragmentCompat, Preference preference) {
    final String key = preference.getKey();
    DialogFragment f;
    if (preference instanceof ColorPreference) {
        f = XpColorPreferenceDialogFragment.newInstance(key);
    } else {
        return false;
    }

    f.setTargetFragment(preferenceFragmentCompat, 0);
    f.show(this.getSupportFragmentManager(), key);
    return true;
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:15,代码来源:SettingsActivity.java

示例7: showConfirmGoBackDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void showConfirmGoBackDialog() {

        if (!mTimeControl.isEqual(mTimeControlSnapshot)) {
            DialogFragment newFragment = ExitConfirmationDialogFragment.newInstance();
            newFragment.setTargetFragment(this, REQUEST_EXIT_DIALOG);
            newFragment.show(getFragmentManager(), TAG_EXIT_DIALOG_FRAGMENT);
        } else {
            getActivity().getSupportFragmentManager().popBackStack();
        }
    }
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:11,代码来源:TimeControlFragment.java

示例8: showStageEditorDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
/**
 * Launch Stage Editor Dialog where the user can manipulate the Stage's properties.
 */
private void showStageEditorDialog() {

    // Get correct Stage.
    Stage stage = mTimeControl.getStageManager().getStages()[mEditableStageIndex];

    // Setup Stage Editor Dialog.
    DialogFragment newFragment = new StageEditorDialogFragment(getActivity(), stage);
    newFragment.setTargetFragment(this, REQUEST_STAGE_DIALOG);

    // Launch Stage Editor Dialog.
    newFragment.show(getActivity().getSupportFragmentManager(), TAG_STAGE_EDITOR_DIALOG_FRAGMENT);
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:16,代码来源:TimeControlFragment.java

示例9: showTimeIncrementEditorDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void showTimeIncrementEditorDialog() {

        // Get Time Increment
        TimeIncrement timeIncrement = mTimeControl.getTimeIncrement();

        // Setup Time Increment Editor Dialog
        DialogFragment newFragment = new TimeIncrementEditorDialogFragment(getActivity(), timeIncrement);
        newFragment.setTargetFragment(this, REQUEST_TIME_INCREMENT_DIALOG);

        // Launch Time Increment Editor Dialog.
        newFragment.show(getActivity().getSupportFragmentManager(), TAG_TIME_INCREMENT_EDITOR_DIALOG_FRAGMENT);
    }
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:13,代码来源:TimeControlFragment.java

示例10: showDiaryEntryDeletionMessage

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void showDiaryEntryDeletionMessage(final int position) {
    mDeletionPosition = position;
    DialogFragment newFragment = new DeleteDiaryEntryDialogFragment();
    newFragment.setTargetFragment(this, ENTRY_DELETION_REQ_CODE);
    newFragment.show(getFragmentManager(), "delete entry");
}
 
开发者ID:jgevans,项目名称:TherapyGuide,代码行数:8,代码来源:DiaryFragment.java

示例11: showTimePickerDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void showTimePickerDialog() {
    DialogFragment dialogFragment = new TimePickerFragment();
    dialogFragment.setTargetFragment(this, 0);
    dialogFragment.show(getActivity().getSupportFragmentManager(), "timePicker");
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:6,代码来源:CreatePoiFragment.java

示例12: featureSelectorDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void featureSelectorDialog() {
    DialogFragment dialogFragment = PoiFeatureDialogFragment.newInstance();
    dialogFragment.setTargetFragment(this, 1);
    dialogFragment.show(getActivity().getSupportFragmentManager(), "PoiFeatureDialogFragment");
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:6,代码来源:CreatePoiFragment.java

示例13: onClick

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
    DialogFragment f = null;

    switch (view.getId()) {
        /* Setting scheduled time. */
        case R.id.fragment_note_scheduled_button:
            f = TimestampDialogFragment.getInstance(
                    R.id.fragment_note_scheduled_button,
                    R.string.schedule,
                    mNote.getId(),
                    mNote.getHead().getScheduled() != null ? mNote.getHead().getScheduled().getStartTime() : null);
            break;

        /* Setting deadline time. */
        case R.id.fragment_note_deadline_button:
            f = TimestampDialogFragment.getInstance(
                    R.id.fragment_note_deadline_button,
                    R.string.deadline,
                    mNote.getId(),
                    mNote.getHead().getDeadline() != null ? mNote.getHead().getDeadline().getStartTime() : null);
            break;

        /* Setting closed time. */
        case R.id.fragment_note_closed_button:
            f = TimestampDialogFragment.getInstance(
                    R.id.fragment_note_closed_button,
                    R.string.closed,
                    mNote.getId(),
                    mNote.getHead().getClosed() != null ? mNote.getHead().getClosed().getStartTime() : null);
            break;

        /* New property. */
        case R.id.add_property:
            /* Add a new property with empty name and value. */
            addPropertyToList(null);
            break;
    }

    if (f != null) {
        f.setTargetFragment(this, 0);
        f.show(getActivity().getSupportFragmentManager(), TimestampDialogFragment.FRAGMENT_TAG);
    }
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:45,代码来源:NoteFragment.java

示例14: showDiaryEntryDeletionMessage

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void showDiaryEntryDeletionMessage() {
    DialogFragment newFragment = new DeleteDiaryEntryDialogFragment();
    newFragment.setTargetFragment(this, ENTRY_DELETION_REQ_CODE);
    newFragment.show(getFragmentManager(), "delete entry");
}
 
开发者ID:jgevans,项目名称:TherapyGuide,代码行数:7,代码来源:EditDiaryEntryFragment.java


注:本文中的android.support.v4.app.DialogFragment.setTargetFragment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。