public Context ctx;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.ctx = this;
//another code......)
send = (Button)findViewById(R.id.wyslij_zapytanie_ofertowe);
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ProgressDialog dialog = ProgressDialog.show(ctx, "Loading", "Please wait...", true);
try {
GMailSender sender = new GMailSender("dasdda@gmail.com", "ddx");
sender.sendMail("This is Subject",
"This is Body",
"staxxxowe@gmail.com",
"xxxyk@gmail.com");
dialog.dismiss();
} catch (Exception e) {
Log.e("SendMail", e.getMessage(), e);
dialog.dismiss();
}
}
});
我也尝试 ctx put ClassName.class 并且也不起作用。有人知道如何解决这个问题吗?