Sub dialogoAudio_Complete(job As HttpJob)
Dim jobTagTemp As JobTag
jobTagTemp.Initialize
jobTagTemp = job.Tag
Dim out As OutputStream
Dim banderaObject As banderaObjeto
banderaObject = BaseDatos.ObtenerBandera("almacenamiento")
If banderaObject.valor = 1 Then
out = File.OpenOutput(File.DirRootExternal & "/mybackpackguide/audios/dialogos", jobTagTemp.Data.fileName, False)
Else
out = File.OpenOutput(File.DirDefaultExternal & "/audios/dialogos", jobTagTemp.Data.fileName, False)
End If
File.Copy2(job.GetInputStream, out)
job.Release
' Descargamos los archivos media
contadorDeMediaParaDescargar = contadorDeMediaParaDescargar + 1
If contadorDeMediaParaDescargar <= mediaParaDescargarList.Size Then
' Actualzamos el dialogo de progreso
ProgressDialogHide
ProgressDialogShow2("FILE " & contadorDeMediaParaDescargar & " of " & mediaParaDescargarList.Size, False)
' Obtenemos el objeto
Dim tempDownloadData As DownloadData
tempDownloadData = mediaParaDescargarList.Get(contadorDeMediaParaDescargar - 1)
' Descagamos
CallSubDelayed2(DownloadService, "StartDownload", tempDownloadData)
Else
' Actualizamos la bandera
BaseDatos.ActualizarBandera("sync", Comun.ObtenerFechaActual, 1)
' Mostramos mensaje de confirmación
StartActivity(Main)
Msgbox("Updated finished.", "")
End If
End Sub
Sub dialogoAudio_Progress(Progress As Long, Total As Long)
End Sub