android - Activity skipping 100s of frames? Taking too long to appear? -


activity taking long appear. don't know why, has simple layout 500 frames or more getting skipped every time. not doing heavy work, stupid setting main layout file.

package zafus.pointme; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem;   public class createeventactivity extends actionbaractivity {      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_create_event);       }       @override     public boolean oncreateoptionsmenu(menu menu) {         // inflate menu; adds items action bar if present.         getmenuinflater().inflate(r.menu.menu_create_event, menu);         return true;     }      @override     public boolean onoptionsitemselected(menuitem item) {         // handle action bar item clicks here. action bar         // automatically handle clicks on home/up button, long         // specify parent activity in androidmanifest.xml.         int id = item.getitemid();          //noinspection simplifiableifstatement         if (id == r.id.action_settings) {             return true;         }          return super.onoptionsitemselected(item);     } } 

here layout.xml activity.

<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:paddingleft="@dimen/activity_horizontal_margin"      android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     android:paddingbottom="@dimen/activity_vertical_margin"     tools:context="zafus.pointme.createeventactivity">      <textview android:id="@+id/create_event_fromal" android:text="create new event , send invites friends , family." android:textsize="20sp" android:textcolor="#0099cc" android:layout_width="wrap_content"     android:layout_height="wrap_content" />        <textview        android:id="@+id/recepient"         android:layout_below="@+id/create_event_fromal"        android:layout_margintop="15dp"         android:layout_alignparentleft="true"        android:layout_width="wrap_content"        android:text="send to: "        android:textcolor="#0099cc"        android:layout_height="wrap_content" />      <edittext         android:id="@+id/recepient_contact"            android:layout_width="fill_parent"         android:layout_below="@+id/create_event_fromal"         android:layout_margintop="15dp"         android:layout_torightof="@+id/recepient"         android:hint="tap add recepients"         android:layout_alignbaseline="@+id/recepient"         android:layout_height="wrap_content" />     <linearlayout         android:layout_below="@+id/recepient_contact"         android:layout_margintop="10dp"         android:id="@+id/create_event_image"         android:layout_alignparentleft="true"         android:orientation="vertical"          android:gravity="bottom"         android:layout_width="wrap_content"         android:layout_height="wrap_content">          <imageview             android:id="@+id/event_picture"             android:layout_width="100dp"             android:scaletype="fitxy"             android:src="@drawable/arrow_use"             android:layout_height="100dp" />          <textview             android:textcolor="#0099cc"             android:layout_width="100dp"             android:text="featured image"             android:layout_height="wrap_content" />          </linearlayout>          <edittext             android:layout_width="fill_parent"             android:id="@+id/title"             android:hint="event title"             android:layout_height="wrap_content"             android:layout_below="@+id/recepient"             android:layout_margintop="20dp"             android:layout_marginleft="10dp"             android:layout_toendof="@+id/create_event_image"             android:layout_torightof="@+id/create_event_image" />             <textview             android:id="@+id/when"             android:layout_width="wrap_content"             android:textcolor="#0099cc"             android:text="when: "              android:layout_marginbottom="21dp"             android:layout_height="wrap_content"             android:layout_alignbottom="@+id/create_event_image"             android:layout_centerhorizontal="true" />      <edittext         android:id="@+id/comment"         android:layout_height="wrap_content"         android:layout_width="fill_parent"         android:layout_below="@+id/create_event_image"         android:layout_margintop="4dp"         android:hint="comment if any"          />      <calendarview         android:id="@+id/datepicker"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="5dp"         android:layout_marginbottom="4dp"         android:layout_above="@+id/comment"         android:layout_torightof="@+id/when"         android:layout_toendof="@+id/when">       </calendarview>  </relativelayout> 

this logcat says:

07-17 13:15:18.001      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:15:18.001      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:15:18.003      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:15:18.003      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:15:18.004      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:15:18.004      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:15:18.088      637-637/zafus.pointme i/choreographer﹕ skipped 372 frames!  application may doing work on main thread. 07-17 13:15:26.544      637-652/zafus.pointme i/art﹕ background partial concurrent mark sweep gc freed 212268(7mb) allocspace objects, 0(0b) los objects, 36% free, 28mb/44mb, paused 3.387ms total 136.810ms 07-17 13:15:41.899      637-647/zafus.pointme w/art﹕ suspending threads took: 19.104ms 07-17 13:15:41.912      637-652/zafus.pointme i/art﹕ background sticky concurrent mark sweep gc freed 414866(14mb) allocspace objects, 0(0b) los objects, 21% free, 29mb/37mb, paused 2.258ms total 132.690ms 07-17 13:16:45.033      637-647/zafus.pointme w/art﹕ suspending threads took: 7.965ms 07-17 13:17:09.585      637-647/zafus.pointme w/art﹕ suspending threads took: 6.500ms 07-17 13:17:19.262      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.262      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.262      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.262      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.265      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.265      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.293      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.293      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.293      637-637/zafus.pointme d/bubblepopuphelper﹕ isshowingbubblepopup : false 07-17 13:17:19.297      637-637/zafus.pointme i/timeline﹕ timeline: activity_idle id: android.os.binderproxy@7dca64b time:14405839 

there seems weird behavior loading calendarview. dealt issue in datepicker setting android:calendarviewshown="false", speeds nicely. perhaps try too.

edit: has several questions calendarviews performance, example calendarview takes time displaying


Comments