13

I just did an update of my SDK and now eclipse is giving me all sorts of totally unwanted warnings in my xml... for example I have a RelativeLayout that doesn't have an id or a background (it's actually a transparent button) and eclipse is warning me that it's a useless element. Is there a way to turn this idiocy off?

TIA

Yevgeny Simkin
  • 27,946
  • 39
  • 137
  • 236
  • http://stackoverflow.com/questions/8711878/android-layout-creation-issue – Samir Mangroliya Apr 06 '12 at 04:51
  • In `RelativeLayout` what you are doing ,do this layout have child. – Herry Apr 06 '12 at 04:59
  • If you can put your xml also it clear me your Issue.Because if Lint tool give warning that means you are doing some thing wrong in xml and may be your layout is not optimize. – Herry Apr 06 '12 at 05:00
  • 1
    No no, my layout is fine. Whoever designed this piece of nonsense just didn't anticipate every way in which someone might use a layout. Anyway, I've turned it off and everything is back to fabulous. – Yevgeny Simkin Apr 06 '12 at 06:02

2 Answers2

14

According to the documentation at http://tools.android.com/recent/ignoringlintwarnings you do this by including the tools xmlns:

xmlns:tools="http://schemas.android.com/tools"

And then adding a tools:ignore annotation in the relevant elements:

<RelativeLayout
    tools:ignore="UselessParent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="30dp"
    android:layout_centerInParent="true">

This still works perfectly in 2022.

Fattie
  • 27,874
  • 70
  • 431
  • 719
alphonzo79
  • 938
  • 11
  • 12
8

In New Update of Eclipse ADT Plugins will give you New Tool Which Name is Lint here is one SO Link for this tool and it's advantages .Click Here

Now for Disable xml Warnings that are come from Lint Android Tool ,you need to go

Window-->Preferences-->Android-->Lint Error Checking

in this Dialog you will find all Issue for Xml in android and you can make disable it ,if you want to disable.And Make sure you will not disable usefull lint warning because it's help us to find there are multiple ID assign in xml and lot more..

Community
  • 1
  • 1
Herry
  • 7,037
  • 7
  • 50
  • 80