I know everyone just loads native library when class is loaded like static {System.loadLibrary("libXXX")}. Recently I found that the StrictMode shows DiskReadViolation at System.loadLibrary, should I move it to non-UI thread? It seems not easy to implement. Is there any official documentation that explains what to do?
Best practice for loading native library async
40 views Asked by Namek Master At
1
The intent behind StrictMode is to help you catch potentially blocking operations while the app is being used, however in this case the
System.loadLibrarycall happens long before the screen is changed as it is in a class initializer.From the documentation on StrictMode: