在Android上创建单独的线程后,他们尝试获取原始URL。通过短URL。 但是我没听懂-对不起,不是母语为英语的人。
我的代码:
public class Expander_URL{
private String expandURL="";
private URL url;
public String Expand(String short_url)throws IOException {
url = new URL(short_url);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setInstanceFollowRedirects(false);
conn.setRequestMethod("HEAD");
this.expandURL = conn.getHeaderField("Location");
conn.disconnect();
return this.expandURL;
}
}