出现以下错误,是因为没建文件。
在main_activity中pulic class void main_activity中将main_activity改成MainActivity,要与.java文件名一致。
附加calculator_act代码:
<?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="*" android:background="#000000"> <TextView android:gravity="bottom|right" android:textSize="70dp" android:ellipsize="end" android:lines="1" android:layout_width="match_parent" android:layout_height="120dp" android:background="@drawable/white_bg" android:id="@+id/textView"/> <TableRow android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="20dp"> <Button android:text="AC" android:textAllCaps="false" android:background="@drawable/orange_change" android:layout_width="match_parent" android:layout_height="70dp" android:textSize="35dp" android:layout_span="1" android:layout_marginTop="10dp" android:id="@+id/bt_clean"/> <Button android:text="Del" android:textAllCaps=