android - When i try to remove the play imageView,the app crashes -


when try remove play imageview,the app crashes.
otherwise works fine decided remove play imageview there.
android studio compiles without problem when open app in phone, crashes

<?xml version="1.0" encoding="utf-8"?> <relativelayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     xmlns:ads="http://schemas.android.com/apk/res-auto"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:descendantfocusability="blocksdescendants"     android:background="@drawable/white_selector"     android:paddingtop="20dp"     android:paddingbottom="20dp"     android:paddingright="16dp"     android:paddingleft="16dp">      <imageview         android:id="@+id/logo"         android:layout_width="40dp"         android:layout_height="30dp"         android:layout_alignparentleft="true"         android:src="@mipmap/ic_launcher"         android:contentdescription="@string/audio_play"/>       <linearlayout         android:id="@+id/badges"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="4dp"         android:layout_marginstart="4dp"         android:layout_centervertical="true"         android:layout_alignparentright="true"         android:layout_alignparentend="true">          <imageview             android:id="@+id/play"             android:layout_width="40dp"             android:layout_height="30dp"             android:src="@drawable/ic_play"             android:contentdescription="@string/audio_play"/>          <textview             android:id="@+id/duration"             android:layout_width="40dp"             android:layout_height="30dp"             android:layout_marginleft="5dp"             android:layout_marginstart="5dp"             android:textcolor="@color/colorprimarydark"             android:textsize="15sp"             android:gravity="center"             tools:text="3:05"/>     </linearlayout>      <textview         android:id="@+id/name"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_centervertical="true"         android:layout_torightof="@+id/logo"         android:layout_toendof="@id/logo"         android:layout_toleftof="@+id/badges"         android:layout_tostartof="@+id/badges"         android:textcolor="@color/coloraccent"         tools:text="martin garrix - animals"/> </relativelayout> 

you referencing image view somewhere in application. example,

...  mimageview = (imageview) findviewbyid(r.id.logo); 

you need remove reference or application crash.

ps: include stack trace int question.


Comments