Inv Resource Directory name errs - layout land


#1

Hi,

I’m getting the following error from the layout - land folder. Its complaining on the first line <FrameLayout. Has anyone run into this issue? :smiley:

The following is the code I have in this layout:

<TextView
    android:id="@+id/question_text_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravety="center_horizontal"
    android:padding="24dp"/>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravety="center_vertical|center_horizontal"
    android:orientation="horizontal" >
     
    <Button
     android:id="@+id/true_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/true_button" />

    <Button
     android:id="@+id/false_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/false_button" />

</LinearLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <ImageButton 
     android:id="@+id/prev_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravety="bottom|right"
     android:contentDescription="@string/prev_button"
     android:src="@drawable/arrow_left"
     />
     
    <ImageButton
     android:id="@+id/next_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravety="bottom|right"
     android:contentDescription="@string/next_button"
     android:src="@drawable/arrow_right"
     />
         
</LinearLayout>

#2

I’m also new to Android development and when I try to run the Geoquiz with the new “layout - land” I am getting the following new warnings and errors:

Warning: The environment variable HOME is not set. The following directory will be used to store the Git user global configuration and to define the default location to store repositories: ‘C:\Users\Bob Richardson’. If this is not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

Warning: EGit couldn’t detect the installation path “gitPrefix” of native Git. Hence EGit can’t respect system level Git settings which might be configured in gitPrefix}/etc/gitconfig under the native Git installation directory. The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in this system level configuration. The Git installation location can be configured on the Team > Git > Configuration preference page’s ‘System Settings’ tab. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

No valid Android XML Editor Delegate found for file /GeoQuiz/res/layout - land/activity_main.xml [Res null, type null]

eclipse.buildId=v22.0.1-685705
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product

Info
Sun Jul 21 00:12:19 EDT 2013
No valid Android XML Editor Delegate found for file /GeoQuiz/res/layout - land/activity_main.xml [Res null, type null]


#3

It appears that I fixed part of it. I made an SDK update, changed the folder name from layout - land to layout-land, and discovered that I misspelled GRAVITY. Thant showed up as errors after I made the available updates. Now I’m getting a new error “emulator: ERROR: Unable to load VM from snapshot”.


#4

I can’t believe it I finally got everything working. My Prev/Next arrows are in the botton Left/Right of the land screen. Feels great:)


#5

hi,

can you post your code. i would like to compare. i have everything working but next & prev buttons aren’t lined up correctly.

john


#6

Sure,

Just an FYI - I began the coding in Chapter 5.

in res/layout/activity_main.xml:

<LinearLayout 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:gravity="center"
android:orientation="vertical" >

<TextView
    android:id="@+id/question_text_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="24dp"/>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >
     
    <Button
     android:id="@+id/true_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/true_button" />

    <Button
     android:id="@+id/false_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/false_button" />

</LinearLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >
    <Button
     android:id="@+id/cheat_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/cheat_button" />
</LinearLayout>        

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <ImageButton 
     android:id="@+id/prev_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:contentDescription="@string/prev_button"
     android:src="@drawable/arrow_left"
     />
     
    <ImageButton
     android:id="@+id/next_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:contentDescription="@string/next_button"
     android:src="@drawable/arrow_right"
     />
         
</LinearLayout>

In res/layout-land/activity_mail.xml:

<TextView
    android:id="@+id/question_text_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:padding="24dp" />

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical|center_horizontal"
    android:orientation="horizontal" >
     
    <Button
     android:id="@+id/true_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/true_button" />

    <Button
     android:id="@+id/false_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/false_button" />

</LinearLayout>

    <Button
     android:id="@+id/cheat_button"   
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravity="bottom|center"
     android:text="@string/cheat_button" />


    <ImageButton 
     android:id="@+id/prev_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravity="bottom|left"
     android:contentDescription="@string/prev_button"
     android:src="@drawable/arrow_left"
     />
     
    <ImageButton
     android:id="@+id/next_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravity="bottom|right"
     android:contentDescription="@string/next_button"
     android:src="@drawable/arrow_right"
     />