Fix crashing when selecting release notes on some devices
This commit is contained in:
parent
435251ca41
commit
4c7bdbb284
@ -100,7 +100,11 @@ public class InstallFragment extends Fragment implements CallbackEvent.Listener<
|
|||||||
magiskManager.magiskLink,
|
magiskManager.magiskLink,
|
||||||
Utils.getLegalFilename(filename)))
|
Utils.getLegalFilename(filename)))
|
||||||
.setNeutralButton(R.string.release_notes, (dialog, which) -> {
|
.setNeutralButton(R.string.release_notes, (dialog, which) -> {
|
||||||
magiskManager.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(magiskManager.releaseNoteLink)));
|
if (magiskManager.releaseNoteLink != null) {
|
||||||
|
Intent openReleaseNoteLink = new Intent(Intent.ACTION_VIEW, Uri.parse(magiskManager.releaseNoteLink));
|
||||||
|
openReleaseNoteLink.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
magiskManager.startActivity(openReleaseNoteLink);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.no_thanks, null)
|
.setNegativeButton(R.string.no_thanks, null)
|
||||||
.show();
|
.show();
|
||||||
|
@ -91,10 +91,12 @@ public class Utils {
|
|||||||
isDownloading = true;
|
isDownloading = true;
|
||||||
|
|
||||||
DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||||
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(link));
|
|
||||||
request.setDestinationUri(Uri.fromFile(file));
|
|
||||||
|
|
||||||
receiver.setDownloadID(downloadManager.enqueue(request));
|
if (link != null) {
|
||||||
|
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(link));
|
||||||
|
request.setDestinationUri(Uri.fromFile(file));
|
||||||
|
receiver.setDownloadID(downloadManager.enqueue(request));
|
||||||
|
}
|
||||||
receiver.setFilename(filename);
|
receiver.setFilename(filename);
|
||||||
context.registerReceiver(receiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
context.registerReceiver(receiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user