i have a thread that is connecting to a url to obtaining some data.
Sometimes the method httpConnection.connect(); taked too munch time to get
the response, and i want to limit the loading dialog of this connection
thread to 5 seg.
I tryed adding timeouts into the code, *but it doesn't work*!!
URL formattedUrl = new URL(url);
URLConnection connection = formattedUrl.openConnection();
HttpURLConnection httpConnection = (HttpURLConnection) connection;
So, i must stop the connect method and the thread when 5000 seconds have
passed or when the used has pressed the back key on the phone.
How can this be achieved? i can't find info about doing this work in
android with a url connection thread.