How to open google play protect in android programatically?

2.2k Views Asked by At

I want to open google play protect directly from my app so that user can enable or disable play protect easily.

Image just for refrence

enter image description here

3

There are 3 best solutions below

1
On
   Intent i = new Intent();
    i.setClassName("com.google.android.gms", "com.google.android.gms.security.settings.VerifyAppsSettingsActivity" );
    try {
        startActivity(i);
    } catch (android.content.ActivityNotFoundException ex) {
        Toast.makeText(getApplicationContext(), "Activity Not Found", Toast.LENGTH_LONG).show();
    }
0
On
    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);
1
On

Button 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 );
        }
    });

And Add this line in manifest file