I am using the adapter for delete file on click event but not working i think this might preventing from deleting the file, Manifest permission is given. I want a similar replacement of this because there are codes already done which hard to update due to this issue.
try {
sendBroadcast(new Intent("android.intent.action.MEDIA_MOUNTED", Uri.fromFile(FileUtils.APP_DIRECTORY)));
} catch (Exception e) {
e.printStackTrace();
}
Send Broadcard generate warning trace
W/System.err: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED from pid=12072, uid=10355
2021-04-13 12:30:52.903 12072-21602/com.******** E/sqlite3_android: [IKR-38846] ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.os.Parcel.createException(Parcel.java:2357)
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.os.Parcel.readException(Parcel.java:2340)
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.os.Parcel.readException(Parcel.java:2282)
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.app.IActivityManager$Stub$Proxy.broadcastIntentWithFeature(IActivityManager.java:5684)
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1126)
2021-04-13 12:30:52.903 12072-12072/com.******** W/System.err: at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:468)