本文整理汇总了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");
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}
示例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");
}
示例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");
}
示例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");
}
示例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);
}
}
示例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");
}