Hi, I need to open notifications settings via intent, on Android 7 I used the this code below and works fine, but in Android 9 or 10 it returns "activity not found".
I search over internet and I found this code in java and convert to B4A, I don't know if I did something wrong
I tryed to use this code, but returns "activity not found" as well.
Any solution?
B4X:
Dim in1 As Intent
in1.Initialize("android.settings.APP_NOTIFICATION_SETTINGS", "")
Dim jo As JavaObject
in1.PutExtra("app_uid", jo.InitializeContext.RunMethodJO("getApplicationInfo", Null).GetField("uid"))
in1.PutExtra("app_package", Application.PackageName)
StartActivity(in1)
I search over internet and I found this code in java and convert to B4A, I don't know if I did something wrong
Java:
Intent settingsIntent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName())
.putExtra(Settings.EXTRA_CHANNEL_ID, MY_CHANNEL_ID);
startActivity(settingsIntent);
I tryed to use this code, but returns "activity not found" as well.
Any solution?