-2
@Override
protected Void doInBackground(String... params) {
String type = params[0];
String url= "http://10.0.2.2/login.php" ;
if(type.equals("Singin")) {
try {
URL Singin_url = new URL(url);
//Cannot not resolve method 'openConnection()'
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
return null;
}
爲什麼它不讓我OpenConnection? ,我不能前進,因爲它說'連接'未初始化HttpURLConnection無法打開連接
我在擴展AsyncTask的類中使用它 – Basit