Greetings,
Can B4A coding be used to set the "do not disturb" mode on the phone?
I found this coding on the forum to read what the current "do not disturb" mode is but I want to set that mode.
Can B4A coding be used to set the "do not disturb" mode on the phone?
I found this coding on the forum to read what the current "do not disturb" mode is but I want to set that mode.
B4X:
Dim ret As Int=-1
Dim java As JavaObject
java.InitializeContext
Try
ret =java.RunMethod("check_dnd",Null)
Catch
Log(LastException)
End Try
Select ret
Case 0
Log("DnD off")
Case 2
Log("Total Silence")
Case 3
Log("Alarms Only")
Case -1
Log("SettingNotFoundException occured ?")
End Select