when user clicks on notification, the app details screen now comes up. If there are multiple downloads, the first one is shown.
This commit is contained in:
parent
8a7feba9cc
commit
e827be1b5b
@ -371,6 +371,14 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
return AsyncDownloader.getAppId(this, downloadId);
|
return AsyncDownloader.getAppId(this, downloadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i.hasExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS)) {
|
||||||
|
// we have been passed a DownloadManager download id, so get the app id for it
|
||||||
|
long[] downloadIds = i.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS);
|
||||||
|
if (downloadIds != null && downloadIds.length > 0) {
|
||||||
|
return AsyncDownloader.getAppId(this, downloadIds[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log.e(TAG, "No application ID found in the intent!");
|
Log.e(TAG, "No application ID found in the intent!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -442,8 +450,9 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
|
|
||||||
// Check if a download is running for this app
|
// Check if a download is running for this app
|
||||||
if (AsyncDownloader.isDownloading(this, app.id) >= 0) {
|
if (AsyncDownloader.isDownloading(this, app.id) >= 0) {
|
||||||
// call install to re-setup the listeners and downloaders
|
// call install() to re-setup the listeners and downloaders
|
||||||
// the AsyncDownloader will not restart the download since the download is running
|
// the AsyncDownloader will not restart the download since the download is running,
|
||||||
|
// and thus the version we pass to install() is not important
|
||||||
refreshHeader();
|
refreshHeader();
|
||||||
refreshApkList();
|
refreshApkList();
|
||||||
final Apk apkToInstall = ApkProvider.Helper.find(this, app.id, app.suggestedVercode);
|
final Apk apkToInstall = ApkProvider.Helper.find(this, app.id, app.suggestedVercode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user