The method onClick(View) of type new View.OnClickListener(){} must override a superclass

findViewById(R.id.button01).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				findViewById(R.id.text01).startAnimation(
						AnimationUtils.loadAnimation(AnimationActivity.this,
								R.anim.alpha));
			}
		});


上述代码报错如下

- implements android.view.View.OnClickListener.onClick
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass

查找后发现是jdk版本问题 项目属性---->javaCompiler中的complier compliance level 将1.5改为1.6

The method onClick(View) of type new View.OnClickListener(){} must override a superclass_第1张图片


你可能感兴趣的:(The method onClick(View) of type new View.OnClickListener(){} must override a superclass)