我使用本教程:
爲什麼我不能解決android類中的方法錯誤?
和代碼的一部分,這一點:
protected String doInBackground(String... urls) {
TextView lbl=(TextView) findViewById(R.id.provCODE);
person = new Person();
person.setName(lbl.getText().toString());
//person.setCountry("1853");
//person.setTwitter("1892");
return POST(urls[0],person);
}
但在這一行:
person.setName(lbl.getText().toString());
我得到這個錯誤:
Can not resolve method.
我怎麼能解決什麼情況? 我一個人的類是:
public class Person {
private String name;
private String country;
private String twitter;
//getters & setters....
}
發佈您的Person類。 –
你有人的'setName'嗎?它是公開的嗎? – Blackbelt
我更新我的問題 –