Why can't I override onConfigurationChanged(Configuration)?
android, eclipse, java, overriding
Solution
`onConfigurationChanged()` was added to `View` in API Level 8. Your build target in Eclipse (or the target in `default.properties` for the command line) probably is set to a lower API level.
Problem
I've already seen the similar question here, and I have already added the line ` import android.content.res.Configuration;`. It hasn't helped though. I am writing a class that extends `AdapterView<Adapter>`, and Eclipse will not let me override `onConfigurationChanged(Configuration)`. As seen in the AdapterView page in the Android Docs, the method does indeed exist. So why can't I override it? Here is my implementation: ``` import android.content.Context; import android.content.res.Configuration; import android.view.View; import android.widget.Adapter; import android.widget.AdapterView; public class Foo extends AdapterView<Adapter> { public Foo(Context context) { super(context); // TODO Auto-generated constructor stub } @Override public Adapter getAdapter() { // TODO Auto-generated method stub return null; } @Override public View getSelectedView() { // TODO Auto-generated method stub return null; } @Override public void setAdapter(Adapter adapter) { // TODO Auto-generated method stub } @Override public void setSelection(int position) { // TODO Auto-generated method stub } /* * Error is thrown here... The method onConfigurationChanged(Configuration) of * type Foo must override or implement a supertype method */ @Override protected void onConfigurationChanged(Configuration newConfig) { /* * Error is thrown here... The method onConfigurationChanged(Configuration) is * undefined for the type AdapterView<Adapter> */ super.onConfigurationChanged(newConfig); } } ```