本文整理汇总了Java中com.google.android.gms.common.ErrorDialogFragment类的典型用法代码示例。如果您正苦于以下问题:Java ErrorDialogFragment类的具体用法?Java ErrorDialogFragment怎么用?Java ErrorDialogFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorDialogFragment类属于com.google.android.gms.common包,在下文中一共展示了ErrorDialogFragment类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
点赞 2
import com.google.android.gms.common.ErrorDialogFragment; //导入依赖的package包/类
@Override
public boolean execute(String action, JSONArray data, CallbackContext callbackContext) throws JSONException {
JSONObject jo = new JSONObject();
final CordovaInterface mCordova = this.cordova;
if (action.equals("check")) {
// Check that Google Play services is available
final int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(mCordova.getActivity());
callbackContext.success(jo.put("isGooglePlayServicesAvailable", resultCode == ConnectionResult.SUCCESS));
// If Google Play services is available
if (ConnectionResult.SUCCESS == resultCode) {
// In debug mode, log the status
Log.d(GooglePlayServicesCheck.APPTAG, "Google Play Services is available");
// Continue
return true;
} else { // Google Play services was not available for some reason
mCordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
// Get the error dialog from Google Play services
Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(resultCode, mCordova.getActivity(), 0);
// If Google Play services can provide an error dialog
if (errorDialog != null) {
// Create a new DialogFragment in which to show the error dialog
ErrorDialogFragment errorFragment = ErrorDialogFragment.newInstance(errorDialog);
// Show the error dialog in the DialogFragment
errorFragment.show(mCordova.getActivity().getFragmentManager(), GooglePlayServicesCheck.APPTAG);
}
}
});
}
}
return false;
}
开发者ID:rehmatt,
项目名称:cordova-plugin-googleplayservices-check,
代码行数:36,
代码来源:GooglePlayServicesCheck.java
示例2: showErrorDialog
点赞 2
import com.google.android.gms.common.ErrorDialogFragment; //导入依赖的package包/类
private void showErrorDialog(int errorCode) {
// Create a fragment for the error dialog
ErrorDialogFragment dialogFragment = new ErrorDialogFragment();
// Pass the error that should be displayed
Bundle args = new Bundle();
args.putInt(DIALOG_ERROR, errorCode);
dialogFragment.setArguments(args);
dialogFragment.show(mFragment.getFragmentManager(), "errordialog");
}
开发者ID:Lenddo,
项目名称:android-lenddo-onboarding,
代码行数:10,
代码来源:GoogleSignInHelper.java