私はAndroid/Javaを初めて使用し、いくつかのYouTubeチュートリアルに従っており、xmlレイアウトの1つで深刻な問題に遭遇しました。
android:hint
基本的に、一部のコードで「XMLの解析エラー:整形式ではありません(無効なトークン)」というエラーが表示されますEditText
。私が何を間違えたのか、誰かが私に手がかりを与えることができますか? (ちなみに、コードを機能させようとしていじっていたので、コードが完全に混乱する可能性があります!)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="25dp" >
<EditText
android:id="@+id/etCommands"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/Type a command"
android:inputType="true">
</EditText>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100" >
<Button
android:id="@+id/bResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="20"
android:text="@string/Try Command" >
</Button>
<ToggleButton
android:id="@+id/tbPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="80"
android:checked="true"
android:paddingBottom="3dp"
android:text="@string/ToggleButton" />
</LinearLayout>
<TextView
android:id="@+id/tvResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/Invalid"
</TextView>
</LinearLayout>