android - Click more than 3 times TextView, App gets crashed -


i have 2 textviews inside relativelayout. have put clickable=true relativelayout when clicked relativelayout, both textviews highlighted. have not set intent relativelayout. when click 1 time, not crashing problem is, when immediately click more 3 times relativelayout crashing. in logcat written: e/dalvikvm: not find class 'android.graphics.drawable.rippledrawable', referenced method android.support.v7.widget.appcompatimagehelper.hasoverlappingrendering has faced such problem , fixed?? xml file:

<relativelayout     android:layout_width="match_parent"     android:layout_height="127dp"     android:background="#eeeeee"     android:clickable="true">      <textview         android:id="@+id/txt_ne_ne"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="70dp"         android:layout_marginstart="70dp"         android:text="@string/qayerdan"         android:textsize="12sp"         android:layout_margintop="10dp"         android:textcolor="@color/light_dark"/>     <textview         android:id="@+id/txt_qayerdan_tanlash"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/tanlash"         android:clickable="true"         android:textcolor="@color/black"         android:layout_below="@+id/txt_ne_ne"         android:layout_marginleft="70dp"         android:layout_marginstart="70dp"         android:layout_margintop="1dp"         android:textsize="19sp" />     <textview         android:id="@+id/txt_ne_ne2"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="70dp"         android:layout_marginstart="70dp"         android:text="@string/qayerga"         android:clickable="true"         android:onclick="onclick"         android:textsize="12sp"         android:layout_below="@id/txt_ne_ne"         android:layout_margintop="40dp"         android:textcolor="@color/light_dark"/>     <textview         android:id="@+id/txt_qayerdan_tanlash2"         android:clickable="true"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/tanlash1"         android:textcolor="@color/black"         android:layout_below="@+id/txt_ne_ne2"         android:layout_marginleft="70dp"         android:layout_marginstart="70dp"         android:layout_margintop="1dp"         android:textsize="19sp" /> 

java code:

    public class delhome extends appcompatactivity         implements navigationview.onnavigationitemselectedlistener {      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_del_h);           final toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar);         toolbar.post(new runnable() {             @override             public void run() {                 drawable d = resourcescompat.getdrawable(getresources(), r.drawable.menu, null);                 toolbar.setnavigationicon(d);             }         });         setsupportactionbar(toolbar);          drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout);         actionbardrawertoggle toggle = new actionbardrawertoggle(                 this, drawer, toolbar, r.string.navigation_drawer_open, r.string.navigation_drawer_close);         drawer.setdrawerlistener(toggle);         toggle.syncstate();          navigationview navigationview = (navigationview) findviewbyid(r.id.nav_view);         navigationview.setnavigationitemselectedlistener(this);     }      @override     public void onbackpressed() {         drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout);         if (drawer.isdraweropen(gravitycompat.start)) {             drawer.closedrawer(gravitycompat.start);         } else {             super.onbackpressed();         }     }      @suppresswarnings("statementwithemptybody")     @override     public boolean onnavigationitemselected(menuitem item) {          int id = item.getitemid();          if (id == r.id.nav_buyurt_yar) {          } else if (id == r.id.nav_bosh_sahifa) {          } else if (id == r.id.nav_call_centre) {          } else if (id == r.id.nav_biz_haqimizda) {          } else if (id == r.id.nav_foyd_shartlar) {          } else if (id == r.id.nav_chiqish) {             system.exit(0);         }         drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout);         drawer.closedrawer(gravitycompat.start);         return true;     } } 

have tried set relativelayout's background ? :

with creating background_ripple.xml in drawable resources :

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">     <item android:state_pressed="true">         <shape             xmlns:android="http://schemas.android.com/apk/res/android">             <solid android:color="@color/grey_light"/>         </shape>     </item>     <item android:state_pressed="false">         <shape             xmlns:android="http://schemas.android.com/apk/res/android">             <solid android:color="@color/white"/>         </shape>     </item> </selector> 

and settup in relativelayout

<relativelayout     android:layout_width="match_parent"     android:layout_height="127dp"     android:background="@drawable/background_ripple"     android:clickable="true">  </relativelayout> 

edit : this, android may render ripple effect

i hope you


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -