定义了一个继承了TextView的类LrcView作为自定义控件,在xml文件也写好了。这是部分代码<LinearLayout
android:layout_weight="1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/backcolor"
>
<turr.view.LrcView
android:id="@+id/LyricShow"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</turr.view.LrcView>
</LinearLayout>当我传参到LrcView的对象时,会抛出NullPointerException异常,说不能启动activity,不传参LinearLayout能显示背景颜色,谁能告诉下我?
android:layout_weight="1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/backcolor"
>
<turr.view.LrcView
android:id="@+id/LyricShow"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</turr.view.LrcView>
</LinearLayout>当我传参到LrcView的对象时,会抛出NullPointerException异常,说不能启动activity,不传参LinearLayout能显示背景颜色,谁能告诉下我?
建议将id 改成 短线连接不要使用大写的 如lyric_show