The book told me to create a folder called layout-land and a main.xml file in it. Then gave some code to put in there and in the layout/main.xml files. Now I am having errors in the Sudoku.java file (I guess you could call it the activity file?...) saying that in the code
setContentView(R.layout.main);, layout is underlined red and says that "layout cannot be resolved or is not a field" also in R.java , I am getting errors at
Syntax error on tokens, delete these tokens
public static final class =id{
Illegal modifier for the class string; only public, abstract & final are permitted
public static final class attr {
public static final class color {
public static final class drawable {
public static final class id {
public static final class layout {
public static final class string {
please help
I don't know if this is helpful but..
The code in layout-land/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="15dip" >
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:paddingLeft="20dip"
android:paddingRight="20dip">
<TextView
android:text="@string/main_title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="20dip"
android:textSize="24.5sp" />
<TableLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:stretchColumns="*">
<TableRow>
<Button
android:id="@+=id/continue_button"
android:text="@string/continue_label" />
<Button
android:id="@+id/new_button"
android:text="@string/new_game_label"/>
</TableRow>
<TableRow>
<Button
android:id="@+id/about_button"
android:text="@string/about_label" />
<Button
android:id="@+id/exit_button"
android:text="@string/exit_label" />
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>
code in layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="30dip">
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="center">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/main_title"
android:layout_gravity="center"
android:layout_marginBottom="25dip"
android:textSize="24.5sp"/>
<Button
android:id="@+id/continue_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label"/>
<Button
android:id="@+id/new_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/new_game_label"/>
<Button
android:id="@+id/about_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about_label"/>
<Button
android:id="@+id/exit_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/exit_label"/>
</LinearLayout>
</LinearLayout>

New Topic/Question
Reply


MultiQuote







|