Android Error The method OnClick (View) of type new View.onclicklistener () {} must override a superclass

Source: Internet
Author: User

Today, a source code was downloaded on the web and an error occurred after importing eclipse: The method OnClick (View) type new View.onclicklistener () {} must override a superclass

The problem with the JDK version was found on the Internet.

Solution:

The Complier compliance level in Project---->properties---->javacompiler is changed to 1.5 to 1.6

That is, the Java 1.5 compiler overrides the parent class's method by default, with @override, but 1.6 has been extended to the method of the interface, so if the compiler for Java 1.5 is compiled, an error occurs. Java compiler is version 1.6, select the compilation level of 1.6, but the important point is that the build of the Android library is 1.5, the resulting APK program is able to run on the 1.5 core. In general: The version of the Android SDK and the version of the Java JRE can be configured to use, and the relationship should be loose.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.