'How to open google play protect in android programatically?

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



Solution 1:[1]

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

Solution 2:[2]

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

Solution 3:[3]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Neha Sharma
Solution 2 Mahaveer Singh Kasana
Solution 3 abdul muteen