GoogleApiClient位置对话框 - 获取是/否按钮回调

时间:2016-09-10 09:07:33

标签: android-googleapiclient

enter image description here

对于此对话框,我可以在哪里获得正/ negetive - Yes / No按钮的回调? 另外,如何自定义此Dialog上的文本? 而不是此应用我想插入我的应用名称。而且我不想要使用Google的位置服务.......等等。

1 个答案:

答案 0 :(得分:0)

这是答案。

protected static final int REQUEST_CHECK_SETTINGS = 0x1;

 @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        switch (requestCode) {
            case REQUEST_CHECK_SETTINGS:
                switch (resultCode) {
                    case Activity.RESULT_OK:
                        // All required changes were successfully made

                        break;
                    case Activity.RESULT_CANCELED:
                        // The user was asked to change settings, but chose not to

                        break;
                    default:
                        break;
                }
                break;
        }
    }