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 も試してみましたが、うまくいきません。この問題を解決する方法を知っている人はいますか?