Unfortunately, APP has stopped error. Are there any view limitations for an activity? : <p>I am trying to develop an app for Android with Android studio.
I have a login page and trying to open an another activity named main with button from login page. I have lots of rows in two table layout. You can find codes there.
When i clicked imagebutton in login, sometimes i get Unfortunately, APP has stopped error. Sometimes dont get <strong>with same codes.</strong></p>

<p>Are there any limitations for number of widgets for an activity page?
I am getting this error on emulator.
Here are the codes.
Thank for your replies.</p>

<p><strong>login.java</strong></p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    Button mainBtn = (Button) findViewById(R.id.bt_enter);
    mainBtn.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v)
        {
            Intent intent = new Intent(login.this, main.class);
            startActivity(intent);
        }
    });


}
</code></pre>

<p><strong>content_main</strong></p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="0dp"
    android:paddingLeft="0dp"
    android:paddingRight="0dp"
    android:paddingTop="0dp"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.dasyapi.erp.dait.main"
    tools:showIn="@layout/activity_main"
    android:background="@drawable/gravis"&gt;

    &lt;ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/iv_logo"
        android:src="@drawable/ust_logo"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="false"
        android:layout_alignParentStart="true"
        android:layout_alignParentBottom="false"
        android:layout_alignParentRight="false"
        android:baselineAlignBottom="false"
        android:adjustViewBounds="true" /&gt;

    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/iv_logo"
        android:layout_alignLeft="@+id/iv_logo"
        android:layout_alignRight="@+id/iv_logo"
        android:id="@+id/ly_content"
        android:scrollbars="vertical"
        android:weightSum="1"
        android:paddingTop="20dp"
        android:layout_alignEnd="@+id/iv_logo"
        android:layout_alignStart="@+id/iv_logo"&gt;


        &lt;TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:id="@+id/tl_content"&gt;

            &lt;TableRow
                android:id="@+id/tr_1"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:measureWithLargestChild="false"
                android:gravity="center_horizontal"
                android:paddingBottom="10dp"&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_ajanda"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginRight="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_ajanda"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/ajanda"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_kasa"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginLeft="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_kasa"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/kasa"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

            &lt;/TableRow&gt;

            &lt;TableRow
                android:id="@+id/tr_2"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:measureWithLargestChild="false"
                android:gravity="center_horizontal"
                android:paddingBottom="10dp"&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_siparis"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginRight="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_siparis"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/siparis"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_puantaj"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginLeft="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_puantaj"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/puantaj"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

            &lt;/TableRow&gt;

            &lt;TableRow
                android:id="@+id/tr_3"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:measureWithLargestChild="false"
                android:gravity="center_horizontal"
                android:paddingBottom="10dp"&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_gelirler"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginRight="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_gelirler"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/gelirler"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_giderler"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginLeft="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_giderler"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/giderler"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

            &lt;/TableRow&gt;

            &lt;TableRow
                android:id="@+id/tr_4"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:measureWithLargestChild="false"
                android:gravity="center_horizontal"
                android:paddingBottom="10dp"&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_stoklar"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginRight="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_stoklar"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/stoklar"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_kritik"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginLeft="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_kritik"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/kritik"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

            &lt;/TableRow&gt;

            &lt;TableRow
                android:id="@+id/tr_5"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:measureWithLargestChild="false"
                android:gravity="center_horizontal"
                android:paddingBottom="10dp"&gt;

                &lt;LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ly_sikayet"
                    android:weightSum="1"
                    android:background="@color/dBlueDark"
                    android:layout_marginRight="7dp"&gt;

                    &lt;ImageButton
                        android:layout_width="146dp"
                        android:layout_height="65dp"
                        android:id="@+id/ibt_sikayet"
                        android:soundEffectsEnabled="false"
                        android:adjustViewBounds="true"
                        android:keepScreenOn="false"
                        android:background="@drawable/sikayet"
                        android:clickable="true" /&gt;

                &lt;/LinearLayout&gt;

                &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/ly_tutanak"
                android:weightSum="1"
                android:background="@color/dBlueDark"
                android:layout_marginLeft="7dp"&gt;

                &lt;ImageButton
                    android:layout_width="146dp"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_tutanak"
                    android:soundEffectsEnabled="false"
                    android:adjustViewBounds="true"
                    android:keepScreenOn="false"
                    android:background="@drawable/tutanak"
                    android:clickable="true" /&gt;

            &lt;/LinearLayout&gt;

        &lt;/TableRow&gt;

        &lt;TableRow
            android:id="@+id/tr_6"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:measureWithLargestChild="false"
            android:gravity="center_horizontal"
            android:paddingBottom="10dp"&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/ly_is_kazasi"
                android:weightSum="1"
                android:background="@color/dBlueDark"
                android:layout_marginRight="7dp"&gt;

                &lt;ImageButton
                    android:layout_width="146dp"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_is_kazasi"
                    android:soundEffectsEnabled="false"
                    android:adjustViewBounds="true"
                    android:keepScreenOn="false"
                    android:background="@drawable/is_kazasi"
                    android:clickable="true" /&gt;

            &lt;/LinearLayout&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/ly_kamera"
                android:weightSum="1"
                android:background="@color/dBlueDark"
                android:layout_marginLeft="7dp"&gt;

                &lt;ImageButton
                    android:layout_width="146dp"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_kamera"
                    android:soundEffectsEnabled="false"
                    android:adjustViewBounds="true"
                    android:keepScreenOn="false"
                    android:background="@drawable/kamera"
                    android:clickable="true" /&gt;

            &lt;/LinearLayout&gt;

        &lt;/TableRow&gt;

    &lt;/TableLayout&gt;

&lt;/LinearLayout&gt;

&lt;FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentEnd="false"
    android:id="@+id/fl_bottom"&gt;

    &lt;TableLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="bottom"
        android:id="@+id/tl_bottom"&gt;

        &lt;TableRow
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center_horizontal|bottom"
            android:id="@+id/tr_bottom"&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:id="@+id/ll_personel"&gt;

                &lt;ImageButton
                    android:layout_width="wrap_content"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_personel"
                    android:background="@color/dOrange"
                    android:src="@drawable/personel"
                    android:adjustViewBounds="true"
                    android:clickable="true"
                    android:scaleType="fitXY" /&gt;
            &lt;/LinearLayout&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:id="@+id/ll_taseron"&gt;

                &lt;ImageButton
                    android:layout_width="wrap_content"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_taseron"
                    android:background="@color/dOrange"
                    android:src="@drawable/taseron"
                    android:adjustViewBounds="true"
                    android:clickable="true"
                    android:scaleType="fitXY" /&gt;
            &lt;/LinearLayout&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:id="@+id/ll_musteri"&gt;

                &lt;ImageButton
                    android:layout_width="wrap_content"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_musteri"
                    android:background="@color/dOrange"
                    android:src="@drawable/musteri"
                    android:adjustViewBounds="true"
                    android:clickable="true"
                    android:scaleType="fitXY" /&gt;
            &lt;/LinearLayout&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:id="@+id/ll_threedots"&gt;

                &lt;ImageButton
                    android:layout_width="wrap_content"
                    android:layout_height="65dp"
                    android:id="@+id/ibt_threedots"
                    android:background="@color/dOrange"
                    android:src="@drawable/diger"
                    android:adjustViewBounds="true"
                    android:clickable="true"
                    android:scaleType="fitXY" /&gt;
            &lt;/LinearLayout&gt;
        &lt;/TableRow&gt;
    &lt;/TableLayout&gt;
&lt;/FrameLayout&gt;
</code></pre>

<p></p>
