0
Google Playサービスが利用可能かどうかを確認する共通の機能を作成しようとしています。私は共通の機能を作成しているので、参照番号Activity
が必要なので、getErrorDialog
を使用していません。getErrorResolutionPendingIntentを使用してGoogle Playサービスを確認する方法
私はそれにgetErrorResolutionPendingIntent
のようないくつかのオプションを見ましたが、使い方がわかりません。
は、ここでは、この目的に関連するすべてのアクションを実行するコード
public static boolean isGooglePlayServiceAvailable(Activity activity){
GoogleApiAvailability googleService = GoogleApiAvailability.getInstance();
int result = googleService.isGooglePlayServicesAvailable(getContext());
if(result != ConnectionResult.SUCCESS){
if(googleService.isUserResolvableError(result)){
PendingIntent pendingResults = googleService.getErrorResolutionPendingIntent(getContext(), new ConnectionResult(result));
}else{
Log.e(TAG , "Device not supported");
}
return false;
}
return true;
}
上記のコードで実装する方法 – Hunt