i needed in debugging , finding out why android application keeps on crashing. app crashes on page has listview , each listview row has image , text in it. have created cache class storing bitmaps of images in listview. after staying hour on page(the page listview) app crashes , see in logcat console. cannot understand how crash happening, tips or suggestions on root cause extremely helpful. apologize if information insufficient.
07-21 00:47:07.143 2047-2423/com.app e/parcel﹕ parcel::writedupfiledescriptor failed: fd=931 flags=0 err=0(success) dupfd=-1 duperr=24(too many open files) flags=-1 err=9(bad file number) 07-21 00:47:07.172 2047-2423/com.app e/surface﹕ queuebuffer: error queuing buffer surfacetexture, -22 07-21 00:47:07.172 2047-2423/com.app w/adreno-eglsub﹕ <swapbuffers:1344>: failed queuebuffer 07-21 00:47:07.172 2047-2423/com.app w/adreno-egl﹕ <qegldrvapi_eglswapbuffers:3791>: egl_bad_surface 07-21 00:47:07.595 2047-2423/com.app e/parcel﹕ parcel::writedupfiledescriptor failed: . (the same error above gets repeated couple of times) . . 07-21 00:47:11.685 2047-2423/com.app w/adreno-eglsub﹕ <swapbuffers:1344>: failed queuebuffer 07-21 00:47:11.685 2047-2423/com.app w/adreno-egl﹕ <qegldrvapi_eglswapbuffers:3791>: egl_bad_surface 07-21 00:47:12.128 2047-2423/com.app w/adreno-gsl﹕ <gsl_ldd_control:416>: ioctl fd 28 code 0xc0140933 (ioctl_kgsl_timestamp_event) failed: errno 24 many open files . (the same error above gets repeated couple of times) . . 07-21 00:47:17.839 2047-2047/com.app w/inputmethodmanager﹕ ime died: com.android.inputmethod.latin/.latinime android.os.transactiontoolargeexception i adding xml layout if helpful
<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/framelayout" android:background="@color/black"> <imageview android:layout_width="225dp" android:layout_height="225dp" android:alpha="0.3" android:id="@+id/background_image" android:layout_gravity="center" android:background="@drawable/visual_background_animation_list"/> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start"> <!-- main content view --> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:id="@+id/top_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:background="@drawable/background_holo_dark"> <imageview android:id="@+id/play_pause_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true"/> <seekbar android:layout_marginleft="75dp" android:id="@+id/seek_bar" android:layout_width="match_parent" android:layout_height="wrap_content"/> <imageview android:id="@+id/nxt" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignparentright="true"/> <textview android:layout_alignleft="@+id/nxt" android:layout_below="@+id/seek_bar" android:id="@+id/curr" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:layout_alignright="@+id/nxt" android:layout_below="@+id/seek_bar" android:id="@+id/curr_2" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </relativelayout> <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/top_header"> <listview android:id="@+id/another_list" android:layout_width="match_parent" android:layout_height="match_parent"/> </framelayout> </relativelayout> <!-- navigation drawer --> <relativelayout android:id="@+id/drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="@android:color/darker_gray" android:orientation="vertical"> <listview android:id="@+id/another_list_2" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:choicemode="singlechoice" /> </relativelayout> </android.support.v4.widget.drawerlayout> </framelayout> i wanted mention have animation-list runs , being displayed background image of application.
layout of navigation drawer
layout navigation drawer
<tablelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <tablerow> <textview android:id="@+id/name1"/> </tablerow> <tablerow> <textview android:id="@+id/name2"/> </tablerow> </tablelayout> and layout of listview
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="invisible"> <imageview android:id="@+id/image_on_left" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <relativelayout android:id="@+id/relative_layout_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_torightof="@+id/image_on_left"> <textview android:id="@+id/title1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <relativelayout android:id="@+id/relative_layout_title2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/title1"> <textview android:id="@+id/title2" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </relativelayout> <imageview android:id="@+id/another_image" android:layout_alignparentright="true"/> </relativelayout> </relativelayout>
i did research on net , in code , found out many memory leaks. changed few things rid of error.
i made sure context not being cached in of helper classes (basically utility classes)
also not using holder class in listview
so added following declaration in custom adapter class
static class viewholder { textview name; imageview imageview; } @override public view getview(int position, view convertview, viewgroup parent) { viewholder viewholder = new viewholder(); .... convertview.settag(viewholder); }
Comments
Post a Comment