Android EditText放入布局中后,运行程序就闪退
代码如下<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_heightPercent="83%"
android:background="@color/divilinglinegray">
<com.zhy.android.percent.support.PercentLinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.zhy.android.percent.support.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:background="@color/buttontextwhite">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始时间"
android:textColor="@color/hometextblack"
android:textSize="16sp"
app:layout_marginLeftPercent="4%"/>
<TextView
android:id="@+id/daike_start_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/daike_start_arow"
android:onClick="daike"
android:text="2017-4-15 16:40"
android:textColor="@color/noticeitemtext"
android:textSize="16sp"
app:layout_marginRightPercent="2.5%"/>
<ImageView
android:id="@+id/daike_start_arow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:onClick="daike"
android:src="@mipmap/arow2x"
app:layout_marginRightPercent="4%"/>
</com.zhy.android.percent.support.PercentRelativeLayout>
<include
layout="@layout/layout_line_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.zhy.android.percent.support.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:background="@color/buttontextwhite">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束时间"
android:textColor="@color/hometextblack"
android:textSize="16sp"
app:layout_marginLeftPercent="4%"/>
<TextView
android:id="@+id/daike_end_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/daike_end_arow"
android:text="2017-4-15 16:40"
android:textColor="@color/noticeitemtext"
android:textSize="16sp"
android:onClick="daike"
app:layout_marginRightPercent="2.5%"/>
<ImageView
android:id="@+id/daike_end_arow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@mipmap/arow2x"
android:onClick="daike"
app:layout_marginRightPercent="4%"/>
</com.zhy.android.percent.support.PercentRelativeLayout>
<include android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/layout_line_1"/>
<com.zhy.android.percent.support.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/buttontextwhite"
android:focusable="true"
android:focusableInTouchMode="true">
<TextView
android:id="@+id/daike_reason_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="代课理由"
android:textColor="@color/hometextblack"
android:textSize="15sp"
app:layout_marginLeftPercent="4%"
app:layout_marginTopPercent="10%"/>
<EditText
android:id="@+id/daike_reason"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/buttontextwhite"
android:hint="代课理由"
android:textSize="15sp"
android:layout_toRightOf="@id/daike_reason_text"
app:layout_marginLeftPercent="4%"
app:layout_marginRightPercent="4%"
app:layout_marginTopPercent="10%"
android:gravity="top"/>
</com.zhy.android.percent.support.PercentRelativeLayout>
<LinearLayout
android:id="@+id/daike_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
</LinearLayout>
</com.zhy.android.percent.support.PercentLinearLayout>
</ScrollView>
<Button
android:id="@+id/daike_send"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_widthPercent="92%"
app:layout_heightPercent="6%"
android:background="@drawable/bt_blue_shape"
android:layout_gravity="center_horizontal"
app:layout_marginTopPercent="1.5%"
android:text="发送申请"
android:textColor="@color/buttontextwhite"
android:textSize="17sp"
android:onClick="daike"/>
标注的那一块红色的就是放入的EditText 经测试只要把EditText存在就会闪退
报错是报空指针的错误 该怎么解决
很急 求大神解决!!!!!