Goodevening, im trying to create a progress spinning wheel when an onClick function start but i got an error from eclipse and seems it won’t work.
here is my code
hwdebug.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ProgressDialog MyDialog = ProgressDialog.show( this, "TEST" , "Loading. Please wait ... ", false);
// FUNCTION
MyDialog.dismiss();
}
}
The error im getting from eclipse is that:
The method show(Context, CharSequence, CharSequence, boolean) in the
type ProgressDialog is not applicable for the arguments (new
View.OnClickListener(){}, String, String, boolean)
Any suggestion? Thanks 🙂
Change
to
use Current Activity Context instead of View to show ProgressDialog or you can get Context by using
v.getContext()