Android Question Error customsound NB6

Pooya1

Active Member
Licensed User
Hi
I use NB6 class for show notification
There is problem in use customsound

In my manifest
B4X:
'************ Required with GetSafeDirDefaultExternal ***********
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)
'**************************************

'********************  Required for file provider *************************
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <external-files-path name="name" path="shared" />
)
'***************************************************************

And my code is :
B4X:
If File.Exists(MyLibrary.Permissions.GetSafeDirDefaultExternal("share"),"notification.mp3") Then
        nb.CustomSound(MyLibrary.CreateFileProviderUri(MyLibrary.Permissions.GetSafeDirDefaultExternal("share"),"notification.mp3"))
    Else
        File.Copy(File.DirAssets,"notification.mp3",MyLibrary.Permissions.GetSafeDirDefaultExternal("share"),"notification.mp3")
        nb.CustomSound(MyLibrary.CreateFileProviderUri(MyLibrary.Permissions.GetSafeDirDefaultExternal("share"),"notification.mp3"))
    End If

But i have error
 

Pooya1

Active Member
Licensed User
Problem was solved
In my resource i add below
<?xml version="1.0" encoding="utf-8"?>
<external-files-path name="name" path="shared" />
but i had used share folder while i define shared folder in resource
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…