1

我想直接从我的应用程序中打开 google play Protect,以便用户可以轻松启用或禁用 Play Protect。

图片仅供参考

在此处输入图像描述

4

2 回答 2

1

按钮 btn_play_protectSetting = findViewById(R.id.btn_play_protectSetting);

    btn_play_protectSetting.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent openPlayStoreProtectSetting  = new Intent();
            final String GOOGLE_PLAY_SETTINGS_COMPONENT = "com.google.android.gms";
            final String GOOGLE_PLAY_SETTINGS_ACTIVITY = ".security.settings.VerifyAppsSettingsActivity";
            openPlayStoreProtectSetting .setClassName( GOOGLE_PLAY_SETTINGS_COMPONENT, GOOGLE_PLAY_SETTINGS_COMPONENT + GOOGLE_PLAY_SETTINGS_ACTIVITY);
            startActivity(openPlayStoreProtectSetting );
        }
    });

并在清单文件中添加这一行

于 2019-07-24T12:23:21.683 回答
0
    Intent intent = new Intent();
    final String GOOGLE_PLAY_SETTINGS_COMPONENT = "com.google.android.gms";
    final String GOOGLE_PLAY_SETTINGS_ACTIVITY = ".security.settings.VerifyAppsSettingsActivity";
    intent.setClassName( GOOGLE_PLAY_SETTINGS_COMPONENT, GOOGLE_PLAY_SETTINGS_COMPONENT + GOOGLE_PLAY_SETTINGS_ACTIVITY);
    startActivity(intent);
于 2018-12-03T06:18:07.857 回答