import android.app.Application;
public class MyData extends Application{
private String name;
private String phone;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}
当我在调用者Activity中使用以下代码行发送数据时,我得到一个ClassCastException:
MyData data=(MyData)getApplication();
答案 0 :(得分:0)