I have no idea how to use threads; I was only trying to learn how to make a simple android program, but I'm trying to use an api and I get a NetworkOnMainThread exception. I read that it means I need to put my httpUrlConnection in a background thread (which doInBackground apparently might be helpful for), but I'm having trouble with tutorials on the internet.
I have a method right now called getResults that takes in a string and returns a list. Is there an easy way to adapt doInBackground so that I don't have to change my method?
An example of how to do so using doInBackground (or any other method) would be nice.