android ProgressDialog - needs onClickListener?
I am trying to use the help example of ProgressDialog.show(Context, message, message, boolean). Target Android 2.1 level 7 and using Eclipse. The code is refused with message that new View.onClickListener is the first parameter. I cant find any reference or example of this form in the Android develop开发者_开发百科er help or by googling. Can anyone help please? Ron
It's hard to tell without seeing your code, but it sounds to me that you might be trying to use "this" as a reference to the context as the first parameter, and that you're inside the onClickListener when you're doing it. While in there, "this" doesn't refer to your Activity, but to your OnClickListener. Try saving a reference to your context in the activity's onCreate method and using that as the parameter for the ProgressDialog.show call.
精彩评论