Crash coming in launcher through my widget
<p>I am using 2 button for 2 view and set different adapter for 2 views.i want to put delay so that when i click on first button after that second botton get freez for few milisecond. </p>

<pre><code>   FATAL EXCEPTION: main
java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6899)
at android.widget.GridView.onMeasure(GridView.java:1050)
at android.view.View.measure(View.java:15388)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.launcher2.LauncherAppWidgetHostView.onMeasure(LauncherAppWidgetHostView.java:169)
at android.view.View.measure(View.java:15388)
at com.android.launcher2.CellLayoutChildren.measureChild(CellLayoutChildren.java:249)
at com.android.launcher2.CellLayoutChildren.onMeasure(CellLayoutChildren.java:229)
at android.view.View.measure(View.java:15388)
at com.android.launcher2.CellLayout.onMeasure(CellLayout.java:907)
at android.view.View.measure(View.java:15388)
at com.android.launcher2.PagedView.onMeasure(PagedView.java:1057)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15388)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2375)
at android.view.View.measure(View.java:15388)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1982)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1219)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1398)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1112)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4511)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallb
  action = EDITCHECK
  Force finishing activity com.sec.android.app.launcher/com.android.launcher2.Launcher
</code></pre>
