Help with debugging Error in android custom component EditText
<p>UPDATE</p>

<p>making the inner class 'static' fixed it</p>

<hr>

<p>Please help me find out what the error is in the case below. I have a custom EditText inside an activity which implements the OnKeyListener. It is implemented as an inner class of the Activity</p>

<p>The reason i override plain TickerEditText to parent EditText is because in future i might modify EditText and also wanted to attach a OnKeyListener always to it. </p>

<p>I don't want to do this in Activity's onCreate().</p>

<p>Code compiles fine but I'm having runtime error when the application launches and inflates the view.</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
&gt;
&lt;view
    class="com.example.android.ticker.TickerActivity$TickerEditText" 
    android:id="@+id/tickerText"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:hint="Something !!"
/&gt;
&lt;com.example.android.ticker.customListView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/tickerListView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    style="@style/customListView"
    android:scrollbars="vertical"
    android:listSelector="@drawable/list_selector"
/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>Usage
    public class TickerActivity extends Activity {</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.ticker);

    /** Get Reference to UI objects */
    mTickerListView = (TickerListView)findViewById(R.id.tickerListView);
    mTickerEditText = (EditText)findViewById(R.id.tickerText);
    ...
}

...
...
...
...

public class TickerEditText extends EditText implements OnKeyListener {

    public TickerEditText(Context context) {
        super(context);
    }

    public boolean onKey(View v, int keyCode, KeyEvent event) {

        if(event.getAction() == KeyEvent.ACTION_DOWN)
            if(keyCode == KeyEvent.KEYCODE_ENTER) {
                 //something
                 return true;
            }
        return false;
    }
</code></pre>

<p>Thanks in advance</p>
