??
When writing a view of your own definition, the following errors are sometimes reported:
caused by:java.lang.NoSuchMethodException: <init> [Class Android.content.Context, interface Android.util.AttributeSet]
<view
Android:id= "@id/viewpage_container"
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
Android:layout_alignparentbottom= "true"
android:layout_below= "@id/navigator"
Android:layout_centerhorizontal= "true"
class= "Com.suma.smartview.tv.ui.mainactivity$homeviewpager"
android:paddingtop= "@dimen/px50"/>
public class Mainactivity extends Activity {
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
}
}
The reason for this is that the use of inner classes in XML is wrong. Mainactivity$homeviewpager indicates that there is a static inner class Homeviewpager in the mainactivity. So homeviewpaper should be declared as static ~
??
Caused by:java.lang.NoSuchMethodException: <init> [Class Android.content.Context, interface Android