Hi after a bit of a mental block believing my app was broken i realised I was using an API 22 Image on my emulator, Android 5.1
after reverting back to an API 17 Image the App now works, but as more TV boxes are coming to 5.1 im a little concerned as to why this code fails?
Any Ideas as to why? could i just change the Tempfolder to something else?
after reverting back to an API 17 Image the App now works, but as more TV boxes are coming to 5.1 im a little concerned as to why this code fails?
B4X:
Sub hc_ResponseSuccess (Response As OkHttpResponse, TaskId As Int)
' ********** Modified code *************
Dim cs As CountingOutputStream
'THE NEXT LINE FAILS ON ANDROID 5.1 WITH A DIRECTORY NOT FOUND ERROR!
' Temp folder is set to TempFolder = File.DirInternalCache
cs.Initialize(File.OpenOutput(TempFolder, TaskId, False))
Dim j As HttpJob = TaskIdToJob.Get(TaskId)
If j.Tag <> Null And j.Tag Is JobTag Then
Dim jt As JobTag = j.Tag
jt.CountingStream = cs
jt.Total = Response.ContentLength
If jt.Data.url = "" Then
Log("Job cancelled before downloaded started")
cs.Close
End If
Response.GetAsynchronously("response", cs , _
True, TaskId)
'**************************************
Else
' ************* TEST CODE
Dim job As HttpJob = TaskIdToJob.Get(TaskId)
job.Tag = Response.StatusCode
Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), _
True, TaskId)
End If
End Sub
Any Ideas as to why? could i just change the Tempfolder to something else?