Reputation: 27399
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