user1338942
user1338942

Reputation: 5

error: Error parsing XML: not well-formed (invalid token)?

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

<EditText
    android:id="@+id/etNum"
    android:layout_width="wrap_content"
    android:layout_height="102dp"
    android:hint="@string/Please enter a department number." 
    android:inputType="number"
    />

    <EditText
    android:id="@+id/etName"
    android:layout_width="wrap_content"
    android:layout_height="102dp"
    android:hint="@string/Or enter a department name." 
    android:inputType="string"
    />


<Button
    android:id="@+id/btnSearch"
    android:layout_width="fill_parent"
    android:layout_height="70dp"
    android:text="@string/Search" />


<TextView
    android:id="@+id/tvDisplay"
    android:layout_width="match_parent"
    android:layout_height="0dip"
    android:layout_weight="0.19" />


</LinearLayout>

At the very end of the second EditText, i'm getting a error: Error parsing XML: not well-formed (invalid token). I'm not sure what could be causing this.

Upvotes: 0

Views: 2329

Answers (2)

Zaz Gmy
Zaz Gmy

Reputation: 4356

Basically, EditText inputtype is used to set the input type in your EditText.

The possible values for the android:inputtype are:

text
textCapCharacters
textCapWords
textCapSentences
textAutoCorrect
textAutoComplete
textMultiLine
textImeMultiLine
textNoSuggestions
textUri
textEmailAddress
textEmailSubject
textShortMessage
textLongMessage
textPersonName
textPostalAddress
textPassword
textVisiblePassword
textWebEditText
textFilter
textPhonetic
number
numberSigned
numberDecimal
phone
datetime
date
time

Upvotes: 1

Tananda
Tananda

Reputation: 11

This line gives error: android:inputType="string"

Change input type from string to text. Error: String types not allowed (at 'inputType' with value 'string').

Upvotes: 1

Related Questions