Пользовательский SurfaceView, вызывающий NoSuchMethodException

У меня есть пользовательский вид, расширяющий SurfaceView. XML-макет

<com.myPackage.MyCustomView
  android:id="@+id/mycview"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"/>

Класс это:

public class MyCustomView extends SurfaceView{

public float[] xpositions;
public float[] ypositions;
public String[] units;


public MyCustomView(Context context, float[] xpos, float[] ypos,String[] u) {
    super(context);
    xpositions=xpos;
    ypositions =ypos;
    units=u;


     }
}

В контексте Activity для этого метода у меня есть следующая строка

MyCustomView mv = (MyCustomView)findViewById(R.id.mycview);

Выход Logcat имеет следующее

01-30 01:51:12.124: ERROR/AndroidRuntime(4934): Caused by:  java.lang.NoSuchMethodException:MyCustomView(Context,AttributeSet) 
01-30 01:51:12.124: ERROR/AndroidRuntime(4934):    at java.lang.Class.getMatchingConstructor(Class.java:674) 
01-30 01:51:12.124: ERROR/AndroidRuntime(4934):     at java.lang.Class.getConstructor(Class.java:486) 
01-30 01:51:12.124: ERROR/AndroidRuntime(4934):     at android.view.LayoutInflater.createView(LayoutInflater.java:475)

По какой-то причине мой конструктор вызывает исключение выше. Буду признателен за любую помощь в поиске, что не так с кодом.

ОБНОВЛЕНИЕ: я изменил конструктор, чтобы добавить AttributeSet и в своей деятельности написал следующее:

 XmlPullParser parser = getResources().getXml(R.id.mycview);
 AttributeSet attributes = Xml.asAttributeSet(parser);


 MyCustomView cv = new MyCustomView(this,attributes,xx,yy,uu);
              cv = (MyCustomView)findViewById(R.id.mycview);

Но я получаю тот же вывод logcat.

Ответы на вопрос(1)

Ваш ответ на вопрос