2011-12-26 8 views
0

私はアンドロイドアプリを作る方法を学ぼうとする初心者コーダーです。私はthese tutorialsを使用していますが、私はエラーに遭遇したと思います。それはボタンがAndroid Javaコーディングエラー、援助が必要

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:padding="25dp" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

<EditText 
android:id="@+id/etCommands" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:hint="Type a command" 
android:password="true" /> 

<LinearLayout 
android:weightSum="100" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="horizontal" 

<Button 
    android:layout_weight="20" 
    android:id="@+id/Bresults" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Button" /> 



<ToggleButton 
android:layout_weight="80" 
android:id="@+id/tbPassword" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="ToggleButton" 
android:checked="true" /> 

</LinearLayout> 

<TextView 
android:id="@+id/tvresults" 
android:paddingBottom="10dp" 
android:checked="true" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:gravity="center" 
android:text="invalid" /> 

</LinearLayout> 

私はエラーを取得しています隣に書かれています:

は、ここに私のtext.xmlです。エラーは言う:

あなたはあなたの第2のリニアレイアウト上のタグを閉じる必要があり

Multiple annotations found at this line: - Element type "LinearLayout" must be followed by either attribute specifications, ">" or "/>". - error:error parsing XML:not well-formed (invalid token)"

答えて

1

>

<LinearLayout 
android:weightSum="100" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="horizontal"> <!-- here --> 
+0

ねえ、それは問題全体を解決しました。ありがとう!!! – Alex

0

あなたのポストでcolorcodingはすでに問題を強調しています。 LinearLayout開始タグの後に>を忘れてしまった。

+0

ねえ、それは問題全体を解決しました。ありがとう!!! – Alex

+0

色を見ることが常に役立ちます。この場合、彼らは単に黒くなった。 –

+0

さようなら、私は今それを見る。 Eclipseソフトウェアはそれを黒くしませんでした。しかし、迅速な返信のためにタイ。 – Alex

0

IDEがあなたのxmlがwell-formedではないと訴えています。 IDEのエラーが十分に明確でない場合は、http://www.xmlvalidation.com/などのオンラインバリデーターを試してみてください。