Home > Net >  Settings Intent is not working in SAMSUMG M51
Settings Intent is not working in SAMSUMG M51

Time:11-16

I am using below code :

 var intent=Intent(android.provider.Settings.ACTION_SETTINGS)
        startActivityForResult(
            intent,
            REQUEST_SETTINGS
        )

But it's not opening the Settings screen. I am testing it in SAMSUNG M51.

What might be the issue? Thanks.

CodePudding user response:

Hi, have you tried this ? :

Intent intent = new Intent(android.provider.Settings.ACTION_DEVICE_INFO_SETTINGS);
startActivity(intent);

Also, this is useful as well :

 Intent intent = new Intent();
intent.setClassName(
    "com.android.settings",
    "com.android.settings.Settings$DeviceInfoSettingsActivity"
);
startActivity(intent)

CodePudding user response:

You can use this code to open settings and now its updated way , will work startActivity(Intent(Settings.ACTION_SETTINGS))

  • Related