Android Question Setting notification for my app not working

CorbettMessa

Member
Licensed User
Longtime User
I am trying to use the code below to set a notification ringtone. I have tried it using RINGTONE and NOTIFICATION, but it does not seem to work for just my app. Actually the NOTIFICATION part does not work at all, but the RINGTONE does work, but it sets the default for the entire phone, not just my app. I just want to set the NOTIFICATION sound for this app, can I do that?

B4X:
Sub addRingtone_click
Dim Uri As String

Uri = RM.GetDefault(RM.TYPE_RINGTONE)
RM.ShowRingtonePicker("RM",RM.TYPE_RINGTONE,False,Uri)

End Sub

Sub rm_PickerResult (Success As Boolean, Uri As String)
    If Success Then
        If Uri = "" Then
            ToastMessageShow("Silent was chosen", True)
        Else
            RM.SetDefault(RM.TYPE_RINGTONE,Uri)
            ToastMessageShow("ringtone selected", True)
        End If
    Else
        ToastMessageShow("Error loading ringtone.", True)
    End If   
End Sub
 
Top