Fix ResourcesProvider being closed

This commit is contained in:
canyie 2023-01-20 13:59:06 +08:00 committed by John Wu
parent 0329f00129
commit 15a7e9af57

View File

@ -178,9 +178,8 @@ public class DownloadActivity extends Activity {
decryptResources(new FileOutputStream(fd));
Os.lseek(fd, 0, OsConstants.SEEK_SET);
var loader = new ResourcesLoader();
try (var pfd = ParcelFileDescriptor.dup(fd);
var provider = ResourcesProvider.loadFromTable(pfd, null)) {
loader.addProvider(provider);
try (var pfd = ParcelFileDescriptor.dup(fd)) {
loader.addProvider(ResourcesProvider.loadFromTable(pfd, null));
getResources().addLoaders(loader);
}
} finally {