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