0

I am trying to open screen from system settings with intent from my app. So I have found the name of the activity in android settings and trying to launch it.

The address of the activity is com.android.settings/com.android.settings.SubSettings

So with this code I'm trying to send an intent

val intent = Intent("com.android.settings/com.android.settings.SubSettings")
        intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
        startActivity(intent)

But got this exception

            android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.settings/com.android.settings.SubSettings flg=0x10000000 }
Bob Redity
  • 529
  • 5
  • 14

1 Answers1

0

Maybe try this:

val intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.settings","com.android.settings.SubSettings"));
startActivity(intent);

There's always the documentation available for the Intent class and methods and constants. Also, take a look at this answer

Miguel
  • 41
  • 1
  • 2