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


Java DialogFragment.show方法代码示例

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


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

示例1: 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

示例2: 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

示例3: dontClearForDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Test
public void dontClearForDialog() throws Throwable {
    testFragment.testValue = new AutoClearedValue<>(testFragment, "foo");
    DialogFragment dialogFragment = new DialogFragment();
    dialogFragment.show(testFragment.getFragmentManager(), "dialog");
    dialogFragment.dismiss();
    InstrumentationRegistry.getInstrumentation().waitForIdleSync();
    assertThat(testFragment.testValue.get(), is("foo"));
}
 
开发者ID:googlesamples,项目名称:android-architecture-components,代码行数:10,代码来源:AutoClearedValueTest.java

示例4: onSuccess

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onSuccess(List<String> connectionInfo) {
    if (getActivity() == null) {
        // our activity went away while we worked...
        return;
    }
    if (snackbar != null) {
        snackbar.dismiss();
    }
    DialogFragment newFragment = HtmlDialogFragment.newInstance(connectionInfo.get(0));
    newFragment.show(getActivity().getSupportFragmentManager(), "conninfo");
}
 
开发者ID:gbl08ma,项目名称:underlx,代码行数:13,代码来源:StationGeneralFragment.java

示例5: onFileUploaded

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onFileUploaded(final String fileCode) {
    if (isUIVisible) {
        showUploadDialog = false;
        hideBottomNotice();
        DialogFragment dialog = UploadFileDialog.newInstance(fileCode);
        dialog.show(getActivity().getSupportFragmentManager(), UploadFileDialogTag);
    } else {
        showUploadDialog = true;
        showUploadDialogCode = fileCode;
    }
    mUploadFile.setEnabled(true);
    mUploadFile.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable
            .ic_file_upload_24dp, null));
}
 
开发者ID:metarhia,项目名称:metacom-android,代码行数:16,代码来源:FilesFragment.java

示例6: 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

示例7: pickDate

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void pickDate(View view) {
    /* This function is called when the user presses the "pick the date" button. */
    //Create the arguments for the fragment:
    Bundle defaultDate = new Bundle();
    defaultDate.putInt("year", startingTime.get(Calendar.YEAR));
    defaultDate.putInt("month", startingTime.get(Calendar.MONTH));
    defaultDate.putInt("day", startingTime.get(Calendar.DAY_OF_MONTH));
    //This fragment will allow the user to pick the date, with the default being the date that was picked before:
    DialogFragment dateFragment = new DriveDateFragment();
    dateFragment.setArguments(defaultDate);
    //Start the date fragment:
    dateFragment.show(getSupportFragmentManager(), "DriveDateFragment");
}
 
开发者ID:brianjaustin,项目名称:permitlog-android,代码行数:14,代码来源:CustomDriveDialog.java

示例8: pickTime

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void pickTime(Calendar driveTime) {
    //Create the arguments for the fragment:
    Bundle defaultTime = new Bundle();
    defaultTime.putInt("hour", driveTime.get(Calendar.HOUR_OF_DAY));
    defaultTime.putInt("minute", driveTime.get(Calendar.MINUTE));
    //This fragment will allow the user to pick the date:
    DialogFragment timeFragment = new DriveTimeFragment();
    timeFragment.setArguments(defaultTime);
    //Start the date fragment:
    timeFragment.show(getSupportFragmentManager(), "DriveTimeFragment");
}
 
开发者ID:brianjaustin,项目名称:permitlog-android,代码行数:12,代码来源:CustomDriveDialog.java

示例9: showMemoDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private void showMemoDialog(){
    DialogFragment dialog = new MemoDialogFragment();
    Bundle args = new Bundle();
    args.putSerializable("type", requestMessage.getChallengeType());
    args.putString("opponent", requestMessage.getFrom());
    args.putString("sender", requestMessage.getSender());
    args.putSerializable("date", requestMessage.getTime());
    args.putString("opponentEmail", requestMessage.getFrom());
    dialog.setArguments(args);
    dialog.show(getSupportFragmentManager(), "MemoDialogFragment");
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:12,代码来源:SideBarActivity.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: onCreate

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_feature_dfu);
	isBLESupported();
	if (!isBLEEnabled()) {
		showBLEDialog();
	}
	setGUI();

	// Try to create sample files
	if (FileHelper.newSamplesAvailable(this)) {
		if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
			FileHelper.createSamples(this);
		} else {
			final DialogFragment dialog = PermissionRationaleFragment.getInstance(R.string.permission_sd_text, Manifest.permission.WRITE_EXTERNAL_STORAGE);
			dialog.show(getSupportFragmentManager(), null);
		}
	}

	// restore saved state
	mFileType = DfuService.TYPE_AUTO; // Default
	if (savedInstanceState != null) {
		mFileType = savedInstanceState.getInt(DATA_FILE_TYPE);
		mFileTypeTmp = savedInstanceState.getInt(DATA_FILE_TYPE_TMP);
		mFilePath = savedInstanceState.getString(DATA_FILE_PATH);
		mFileStreamUri = savedInstanceState.getParcelable(DATA_FILE_STREAM);
		mInitFilePath = savedInstanceState.getString(DATA_INIT_FILE_PATH);
		mInitFileStreamUri = savedInstanceState.getParcelable(DATA_INIT_FILE_STREAM);
		mSelectedDevice = savedInstanceState.getParcelable(DATA_DEVICE);
		mStatusOk = mStatusOk || savedInstanceState.getBoolean(DATA_STATUS);
		mUploadButton.setEnabled(mSelectedDevice != null && mStatusOk);
	}
}
 
开发者ID:runtimeco,项目名称:Android-DFU-App,代码行数:35,代码来源:DfuActivity.java

示例12: 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

示例13: createImportDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void createImportDialog() {
    DialogFragment dialogFragment = new ImportSongDialog();
    dialogFragment.show(getSupportFragmentManager(), "Import");
}
 
开发者ID:Davarco,项目名称:Divertio,代码行数:5,代码来源:MainActivity.java

示例14: createDownloadFailureDialog

import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void createDownloadFailureDialog(DialogFragment d) {
    d.dismiss();
    DialogFragment uploadFailureDialog = new DownloadConnectionFailureDialog();
    uploadFailureDialog.show(getSupportFragmentManager(), "UploadFailure");
}
 
开发者ID:Davarco,项目名称:Divertio,代码行数:6,代码来源:MainActivity.java

示例15: 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


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