Android Question (Resolved)ImageDownloader Error on Runtime

Discussion in 'Android Questions' started by Bryanne Vega, May 19, 2015.

  1. Bryanne Vega

    Bryanne Vega Member Licensed User

    Code:
    See Below For Solution
    Code:
    java.lang.IllegalStateException: Target host must not be nullor set in parameters. scheme=null, host=nullpath=www.*.com/*/tutorials/fd130/sale/swipe/1.png
    Here's the code:

    Code:
    TutorialName = parser.NextValue
                    TutorialStepCount=parser.NextValue
                    urlDirectory = parser.NextValue
                    
    Dim links As Map
                    links.Initialize()
                    urlDirectory = urlDirectory.Replace(
    "+","/")
                    
    Log(urlDirectory)
                    links.Put(imageBox, (urlDirectory & CurrentStepCount & 
    ".png"))
                    CallSubDelayed2(ImageDownloader, 
    "Download", links)

    The urlDirectory is getting a VALID URL to a PNG file. the StepCounts are ok (this is used elsewere)
    The response is ok.

    The error occurs in the ImageDownloader module:


    Code:
    If Job.Success Then
            
    Dim bmp As Bitmap = Job.GetBitmap
            
    cache.Put(Job.JobName, bmp)
            
    If tasks.IsInitialized Then
                
    For i = 0 To tasks.Size - 1
                    
    Dim link As String = tasks.GetValueAt(i)
                    
    If link = Job.JobName Then
                        
    Dim iv As ImageView = tasks.GetKeyAt(i)
                        iv.SetBackgroundImage(bmp)
                    
    End If
                
    Next
            
    End If
        
    Else
            
    Log("Error downloading image: " & Job.JobName & CRLF & Job.ErrorMessage)   '<<<<Here
        End If
    Thanks,
     
    Last edited: May 19, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Bryanne Vega

    Bryanne Vega Member Licensed User

    Saw it, thanks for the prompt reply. I get no error. but I dont see the downloaded image. (In my imageview)


    3rd edit: URL is case sensitive
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You will need to create a small project and upload it (File - Export as zip).
     
  5. Bryanne Vega

    Bryanne Vega Member Licensed User

    This post has been resolved, thanks Erel.

    I was missing the HTTP:// and also the URL was case sensitive. Having that fixed, my UI works perfectly.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice