Toran Billups
Toran Billups

Reputation: 27399

What version of Android should I compile for to avoid inner class warning

I'm working with Android 2.1 (update1) and my IntelliJ project settings for the project show:

JDK 1.6 and my project language level is set to 6.0 (@Override in interfaces)

Yet when I do a build inside the IDE or outside with Maven I get the following

warning: Ignoring InnerClasses attribute for an anonymous inner class

This line of code (might) be the issue but if so how "should" i do this in a 1.6 friendly build of Android?

public class HelloAndroidActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        final Button viewButton = (Button) findViewById(R.id.loadViewBtn);
        viewButton.setOnClickListener(new View.OnClickListener() {
                @Override //this says override is not allowed when impl interface method??
                public void onClick(View view) {
                    Intent viewActivity = new Intent(HelloAndroidActivity.this, ViewPhotosActivity.class);
                    startActivity(viewActivity);
                }
            });

Upvotes: 0

Views: 124

Answers (1)

Jayyrus
Jayyrus

Reputation: 13051

just delete the text @override

Upvotes: 1

Related Questions