2015-08-21 134 views
-2

AutocompleteTextView第一线我要添加namespace..but它给我的错误一样tag name is not closed ......或者说如何添加此命名空间..标签未关闭

<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:paddingLeft="@dimen/activity_horizontal_margin" 
      android:paddingRight="@dimen/activity_horizontal_margin" 
      android:paddingTop="@dimen/activity_vertical_margin" 
      android:paddingBottom="@dimen/activity_vertical_margin" 
      tools:context="com.nxtstepzedu.nxtstepz.nxtstepz.S1Activity" 
      android:orientation="vertical"> 

     <schemas.android.com/apk/res/android".InstantAutoComplete 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/atcatogory" 
     android:textColor="#000000" 
     android:hint="Search for gym etc..."/> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="IN" 
     android:textSize="25sp" 
     android:layout_marginTop="20sp"/> 

    <AutoCompleteTextView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/atlocation" 
    android:textColor="#000000" 
    android:layout_marginTop="10sp" 
    android:hint="Search for locations..." /> 

</LinearLayout> 
+0

,但它告诉我添加的命名空间,然后自定义类的名字,我没有,但它给人的错误..“标签未关闭”。 –

+0

首先所有这些都确保您的XML已经过适当的验证元素或空格,但它也没有匹配的引号数。 – openshac

+0

thanx解决方案..这个建议为我工作.. –

回答

0

确保您的XML是经过适当验证的元素或空间,并且必须具有匹配的引号数量。

0

我删除类并保持AutocompleteTextView,因为它是在OnCreate中(),我用的方法......它的正常工作....这些方法..,

auto1.setOnFocusChangeListener(新景观。 OnFocusChangeListener(){

 @Override 
     public void onFocusChange(View v, boolean hasFocus) { 
      if (hasFocus) 
       auto1.showDropDown(); 

     } 
    }); 

    auto1.setOnTouchListener(new View.OnTouchListener() { 

     @Override 
     public boolean onTouch(View v, MotionEvent event) { 
      auto1.showDropDown(); 
      return false; 
     } 
    }); 
在主类

,AUTO1是我想要AutoCompleteTextview定制AutoCompleteTextView

的对象