在设备API 19上运行应用程序并打开(搜索活动)时,应用程序崩溃了,但是当在设备24 API上运行应用程序时,应用程序100%正常运行。
搜索布局的代码XML
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.abdullrahman.eng.myapptest.Search">
<ImageView
android:id="@+id/imageVIew"
android:layout_marginTop="10dp"
android:layout_gravity="center_horizontal"
android:layout_width="200dp"
android:layout_height="35dp" />
<TextView
android:id="@+id/se_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="@+id/imageVIew"
android:layout_marginTop="12dp"
android:fontFamily="@font/kite_one"
android:text="Search for people"
android:textColor="@color/bluePrim"
android:textSize="25sp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp">
<EditText
android:id="@+id/se_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="19dp"
android:background="@drawable/se_back"
android:drawableRight="@drawable/se_bt"
android:layout_gravity="center_vertical|center_horizontal"
android:ems="10"
android:fontFamily="@font/kite_one"
android:inputType="textPersonName"
android:maxLines="1"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:textColor="#95989A" />
</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/results_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp">
</android.support.v7.widget.RecyclerView> </LinearLayout>
这是我的logcat,点击按钮打开搜索活动
02-10 16:50:15.260 18502-18502/com.abdullrahman.eng.myapptest W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x415f6c80)
02-10 16:50:32.080 18502-18502/com.abdullrahman.eng.myapptest I/Process: Sending signal. PID: 18502 SIG: 9 –