android菜瓜笔记之android lint problem

在清理代码时遇到一个XML布局文件错误,类型为android lint problem,指出在fragment标签中发现意外的命名空间前缀"app"。错误位于fr_discover.xml的第6行。解决方法是在Eclipse的problems标签中找到该错误,通过quick fix禁用对该文件的检查。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天修改代码,将功成clean了一次,结果出现了错误,某个xml的布局文件报错。错误为:

错误类型为android lint problem

Unexpected namespace prefix "app" found for tag fragment fr_discover.xml /Test/res/layout line 6 Android Lint Problem

xml布局文件为

<?xml version="1.0" encoding="utf-8"?>
<com.livestream.android.widgets.KeyboardAwareLinearLayout android:orientation="vertical" android:id="@id/fr_discover_root_layout" android:background="#ffdde2e8" android:layout_width="fill_parent" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
    <fragment android:name="com.livestream.android.fragment.HeaderFragment_" android:id="@id/fr_discover_header_fragment" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
        <span style="color:#ff6666;"><strong><fragment android:name="com.livestream.android.fragment.EventsListFragment_" android:id="@id/fr_discover_events_list_fragment" android:layout_width="fill_parent" android:layout_height="fill_parent" app:header="@layout/tr_fr_search_listview_header" /></strong>
</span>        <FrameLayout android:id="@id/fr_search_listview_layout" android:background="#ff303030" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <ListView android:id="@id/fr_search_listview" android:background="@color/transparent" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:divider="#ff262626" android:dividerHeight="1.0dip" />
        </FrameLayout>
    </FrameLayout>
</com.livestream.android.widgets.KeyboardAwareLinearLayout>


报错部分为红色字体部分

 

解决办法:

到eclips的problems 标签找到这个错误然后选择quick fix菜单,在弹出的菜单中选择不检查这个文件(Disable check in this file only)就可以了.

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值