我試圖在Eclipse中編寫的Android Studio link中重寫應用程序。有兩個問題,第一個問題是項目中有這一行:錯誤:無法找到符號類AsyncCallWS Android
import com.example.webserviceactivity.R;
我無法在Android Studio上編寫這一行。 第二個問題是,在這部分代碼:
b = (Button) findViewById(R.id.button1);
//Button Click Listener
b.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
//Check if Celcius text control is not empty
if (et.getText().length() != 0 && et.getText().toString() != "") {
//Get the text control value
celcius = et.getText().toString();
//Create instance for AsyncCallWS
AsyncCallWS task = new AsyncCallWS();
//Call execute
task.execute();
//If text control is empty
} else {
tv.setText("Please enter Celcius");
}
}
});
我有這樣的錯誤:
error: cannot find symbol class AsyncCallWS Android in this part :
AsyncCallWS task = new AsyncCallWS();
我該如何解決這些問題呢?謝謝。
什麼是AsyncCallWS?你有進口嗎? – calvinfly
檢查我的答案。接受它,如果它適合你:) –