Google Play サービスがインストールされているかどうかを確認する方法の例に従おうとすると、servicesConnected メソッド内の行に「connectionResult を解決できません」というエラーが表示されます。
int errorCode = connectionResult.getErrorCode();
何が欠けている可能性がありますか?コピー&ペーストしてます。ここの例に従っています
ありがとう!
Google Play サービスがインストールされているかどうかを確認する方法の例に従おうとすると、servicesConnected メソッド内の行に「connectionResult を解決できません」というエラーが表示されます。
int errorCode = connectionResult.getErrorCode();
何が欠けている可能性がありますか?コピー&ペーストしてます。ここの例に従っています
ありがとう!
リターンが欠落していると言った場所への解決策は、else の最後に return false を追加することでした。例:
else { // エラーコードを取得
// Get the error dialog from Google Play services
Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
resultCode,
this,
CONNECTION_FAILURE_RESOLUTION_REQUEST);
// If Google Play services can provide an error dialog
if (errorDialog != null) {
// Create a new DialogFragment for the error dialog
ErrorDialogFragment errorFragment =
new ErrorDialogFragment();
// Set the dialog in the DialogFragment
errorFragment.setDialog(errorDialog);
// Show the error dialog in the DialogFragment
errorFragment.show(getSupportFragmentManager(),
"Location Updates");
}
return false;//THIS NEEDS TO BE FALSE
}