[ONE Android Development] Waszker:
Calculator app is force closing.

Calculator app force closes in portrait mode. In horizontal it works without problems.

I attach log:

V/WindowManager( 3697): Adding window Window{18459e10 u0 com.android.calculator2/com.android.calculator2.Calculator} at 8 of 18 (before Window{12f3e4c2 u0 Starting com.android.calculator2})
D/AndroidRuntime(16731): Shutting down VM
E/AndroidRuntime(16731): FATAL EXCEPTION: main
E/AndroidRuntime(16731): Process: com.android.calculator2, PID: 16731
E/AndroidRuntime(16731): java.lang.ArrayIndexOutOfBoundsException: length=29; index=-1
E/AndroidRuntime(16731):	at android.text.StaticLayout.calculateEllipsis(StaticLayout.java:667)
E/AndroidRuntime(16731):	at android.text.StaticLayout.out(StaticLayout.java:631)
E/AndroidRuntime(16731):	at android.text.StaticLayout.generate(StaticLayout.java:423)
E/AndroidRuntime(16731):	at android.text.StaticLayout.<init>(StaticLayout.java:140)
E/AndroidRuntime(16731):	at android.widget.TextView.makeSingleLayout(TextView.java:6459)
E/AndroidRuntime(16731):	at android.widget.TextView.makeNewLayout(TextView.java:6305)
E/AndroidRuntime(16731):	at android.widget.TextView.onMeasure(TextView.java:6681)
E/AndroidRuntime(16731):	at android.view.View.measure(View.java:17554)
E/AndroidRuntime(16731):	at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1263)
E/AndroidRuntime(16731):	at android.widget.LinearLayout.onMeasure(LinearLayout.java:615)
E/AndroidRuntime(16731):	at android.view.View.measure(View.java:17554)
E/AndroidRuntime(16731):	at android.support.v7.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:5857)
E/AndroidRuntime(16731):	at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1337)
E/AndroidRuntime(16731):	at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1274)
E/AndroidRuntime(16731):	at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:510)
E/AndroidRuntime(16731):	at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2118)
E/AndroidRuntime(16731):	at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2415)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1077)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1077)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
E/AndroidRuntime(16731):	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
E/AndroidRuntime(16731):	at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
E/AndroidRuntime(16731):	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
E/AndroidRuntime(16731):	at android.view.View.layout(View.java:15678)
E/AndroidRuntime(16731):	at android.view.ViewGroup.layout(ViewGroup.java:5039)
E/AndroidRuntime(16731):	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2086)
E/AndroidRuntime(16731):	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)
E/AndroidRuntime(16731):	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
E/AndroidRuntime(16731):	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5891)
E/AndroidRuntime(16731):	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
E/AndroidRuntime(16731):	at android.view.Choreographer.doCallbacks(Choreographer.java:580)
E/AndroidRuntime(16731):	at android.view.Choreographer.doFrame(Choreographer.java:550)
E/AndroidRuntime(16731):	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
E/AndroidRuntime(16731):	at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(16731):	at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(16731):	at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(16731):	at android.app.ActivityThread.main(ActivityThread.java:5293)
E/AndroidRuntime(16731):	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16731):	at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(16731):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime(16731):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
W/ActivityManager( 3697): Force finishing activity 1 com.android.calculator2/.Calculator