Reputation: 19283
I'm trying to open the settings panel from my app but it is not doing anything, the device has Android 14 it's a Samsung A24.
I have another device which is the same model, where the code works. But I'm trying to understand why it doesn't work on the other device:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
context.startActivity(Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY))
} else {
val intent = Intent(Settings.ACTION_DATA_ROAMING_SETTINGS)
context.startActivity(intent)
}
I even tryed to validate if intent was not correct and open default settings app instead of the panel:
Toast.makeText(context, "Clicked secondary button", Toast.LENGTH_SHORT).show()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
val intent = Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY)
if(intent.resolveActivity(context.packageManager) != null) {
context.startActivity(intent)
Log.d("No Internet view", "Opening wireless panel")
} else {
context.startActivity(Intent(Settings.ACTION_WIRELESS_SETTINGS))
Log.d("No Internet view", "Opening wireless settings")
}
} else {
val intent = Intent(Settings.ACTION_DATA_ROAMING_SETTINGS)
context.startActivity(intent)
Log.d("No Internet view", "Opening data roaming settings")
}
However when run, i do receive the log "Opening wireless panel", but nothing is shown on screen.
Any hints on what can be different in a device that blocks this panel?
Upvotes: 0
Views: 88