I have a method called hostPhoto(); it basically uploads an image to a site and retrieves a link.
I then have an other method to post the link to a website.
To your second question:
could someone provide me an explanation why that thread would have caused this?
You call "link= photo.post(filepath);" which is running on a new thread. While that method is still running, link is still null, and your current thread (main thread) continues to run with that link(null at that time)
In this situation you need to wait for the result, so let the new Thread run the method, and after completing, that thread will ask the main thread to update result(by some Callback or Handler), all of those jobs are well encapsulated by Android AsyncTask