Note that there are some explanatory texts on larger screens.

plurals
  1. POAPK expansion file onFinishDownload
    primarykey
    data
    text
    <p>I have this code with wich I download <strong>APK expension file</strong> </p> <pre><code>private void performAPKExpansionCheckAndDownload(){ String APK_LOG = "APK_LOG"; String mainFileName = Helpers.getExpansionAPKFileName(this, true, 2); Log.d(APK_LOG,"mainFileName "+mainFileName); boolean fileExists = Helpers.doesFileExist(this, mainFileName, 38783430L, false); Log.d(APK_LOG,"fileExists "+fileExists); if (!fileExists) { Intent launcher = getIntent(); Intent fromNotification = new Intent(this, getClass()); fromNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); fromNotification.setAction(launcher.getAction()); if (launcher.getCategories() != null) { for (String cat : launcher.getCategories()) { Log.d(APK_LOG,"cat "+cat); fromNotification.addCategory(cat); } } PendingIntent pendingIntent = PendingIntent.getActivity( this, 0, fromNotification, PendingIntent.FLAG_UPDATE_CURRENT); try { int result = DownloaderClientMarshaller.startDownloadServiceIfRequired( this, pendingIntent, MyDownloaderService.class); Log.d(APK_LOG,"result "+result); if (DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED != result) { // implement Downloading UI. return; } } catch (NameNotFoundException e) { Log.e("apk-expansion-files", "NameNotFoundException occurred. " + e.getMessage(), e); } } } </code></pre> <p>The problem is that I need to handle <strong><em>callbacks</em></strong> like <strong><em>onDownloadFinished</em></strong> and <strong><em>onProgressUpdate</em></strong>. I know that thous messages are posted somewhere but I don't know how to handle them. Since I haven't worked with <strong>messages</strong> in <strong>Android</strong> any help would be good.</p> <p>UPDATE:</p> <p>All downloading happens here:</p> <pre><code>int result = DownloaderClientMarshaller.startDownloadServiceIfRequired( this, pendingIntent, MyDownloaderService.class); if (DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED != result) { // implement Downloading UI. return; } </code></pre> <p>I guess those callbacks must be connected to that <strong>DownloaderClientMarshaller</strong> class.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload