score:1

try using following code(i have modified your code, not added any other stuff) :

<?xml version="1.0" encoding="utf-8"?>
<framelayout 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:background="#0099cc"
    tools:context=".mainactivity"
    xmlns:app="http://schemas.android.com/apk/res/com.example.simple_calculator">

    <textview
        android:id="@+id/textview1"
        android:layout_width="match_parent"
        android:layout_height="94dp"
        android:text=""
        android:textappearance="?android:attr/textappearancelarge" />

    <gridlayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginleft="232dp"
        android:layout_margintop="100dp" >
    </gridlayout>

    <gridlayout
        android:layout_width="232dp"
        android:layout_height="match_parent"
        android:layout_margintop="100dp"

       >

        <button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="0"
            android:layout_gravity="left"


            android:text="button" />

    </gridlayout>
</framelayout>

in this code grid layout and the app:column and gravity parts are modified and the exception reported was corrected and code works fine and also for the layout rules please check the following link:

http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/

hope this helps in resolving problem :)

best regards


Related Query

More Query from same tag