mohsen.arian
Member
hi
AddToMediaStore works well on api 29 but gives this error on api 30
Please help, thank you
AddToMediaStore works well on api 29 but gives this error on api 30
B4X:
File.Copy(File.DirAssets, "bounce.mp3", File.DirDefaultExternal, "bounce.mp3")
Dim r As RingtoneManager
Dim u As String
u = r.AddToMediaStore(File.DirDefaultExternal, "bounce.mp3", "Bounce!", False, False, True, False)
r.SetDefault(r.TYPE_RINGTONE, u)
log error:
java.lang.IllegalArgumentException: Unsupported MIME type audio/*
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:549)
at android.content.ContentResolver.insert(ContentResolver.java:2149)
at android.content.ContentResolver.insert(ContentResolver.java:2111)
at anywheresoftware.b4a.phone.RingtoneManagerWrapper.AddToMediaStore(RingtoneManagerWrapper.java:108)
at b4a.example.main._rrr(main.java:436)
at b4a.example.main._button1_click(main.java:369)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7661)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Please help, thank you