0
Google Play 서비스 가용성 확인을 사용 중이며 취소 버튼 (맞춤 cancelClickListener 포함)으로 ErrorDialog를 만들고 싶습니다. 그것을 성취 할 수있는 방법이 있습니까?GooglePlayServicesUtil의 ErrorDialog에 취소 버튼을 추가하는 방법은 무엇입니까?
공공 부울 isGooglePlayServicesAvailable() {
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
if (status == ConnectionResult.SUCCESS) {
return true;
}
else {
int requestCode = 10;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
dialog.setCanceledOnTouchOutside(false);
dialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode,
KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
...
return true;
}
return false;
}
});
dialog.show();
return false;
}
}
감사합니다. 그냥 간단한 방법이 있기를 바랍니다. – user2944063